[Jprogramming] Easy way of testing identity of two verbs?

Roger Hui RHui000 at shaw.ca
Fri Jan 27 07:44:03 HKT 2006


If the outcome of the test is 1, you can be sure that the 
verbs are identical.  That is, if the atomic representations
are equal, then the verbs are identical.  But the converse
is not true:  if the outcome of the test is 0, the verbs
can still be identical.  For example:

   f=: 7&+
   g=: +&7

If the placeholder is last you can eliminate a set of parens.



----- Original Message ----- 
From: "Randy MacDonald" <ramacd at nbnet.nb.ca>
To: "Programming forum" <programming at jsoftware.com>
Sent: Thursday, January 26, 2006 3:06 PM
Subject: Re: [Jprogramming] Easy way of testing identity of two verbs?

Equal representations imply equal verbs, no? Sometimes that is enough.

Also: is there a reason, beyond taste, for putting the placeholder last?

-----------------------------------------------------------------------
|\/| Randy A MacDonald             | you can't pay for it,
|/\| ramacd at nbnet.nb.ca            |       even if you want to.
BSc(Math) UNBF'83 Sapere Aude      | APL: If you can say it, it's done..
Natural Born APL'er                |
----------------------------------------------------(INTP)----{ gnat }-

----- Original Message ----- 
From: "Roger Hui" <RHui000 at shaw.ca>
To: "Programming forum" <programming at jsoftware.com>
Sent: Thursday, January 26, 2006 6:33 AM
Subject: Re: [Jprogramming] Easy way of testing identity of two verbs?


> To be precise, the phrase tests for the identity of the
> gerundial (atomic) representations.  Testing whether two
> verbs are identical is not computable.
>
> Otherwise, I can not think of an easier way, although
> I would use a different placeholder, and put it last.
> You may also have to use -:!.0 instead of -: .
>
>    foo=: +&7
>    foo f.`- -: (+&(7+1e_13))`-
> 1
>    foo f.`- -:!.0 (+&(7+1e_13))`-
> 0
>    foo
> +&7
>    +&(7+1e_13)
> +&7.0000000000001004
>
>
>
>
> ----- Original Message ----- 
> From: "June Kim" <juneaftn at gmail.com>
> To: "Programming forum" <programming at jsoftware.com>
> Sent: Thursday, January 26, 2006 2:13 AM
> Subject: [Jprogramming] Easy way of testing identity of two verbs?
>
> This is how I do it currently.
>
>    u=: >:
>    (]`(u f.)) -: ]`>:
> 1
>    (]`(u f.)) -: ]`<:
> 0
>
> I use ] as a placeholder to use tie. Could you show me easier ways, if
any?




More information about the Programming mailing list