[Jprogramming] @ and @: (atop and at)

Linda A Alvord lindaalvord at verizon.net
Mon Jan 25 17:53:25 UTC 2016


Thanks Dan, Each time I swing around this "tangle of @/@:'s" I seem to get closer to understanding them. But, I still miss some more subtle distinction.

Linda

-----Original Message-----
From: Programming [mailto:programming-bounces at forums.jsoftware.com] On Behalf Of Dan Bron
Sent: Monday, January 25, 2016 11:01 AM
To: J Programming
Subject: Re: [Jprogramming] @ and @: (atop and at)

Linda wrote:
> But, it doesn't mean  f at g and [:f at g  can't be equivalent.

I think you meant f at g and [: f g can sometimes be equivalent (not [: f at g, which always produces a domain error, because you’re trying to execute [:, which cannot be executed).

Two points about that:

  1. f at g and [: f g are equivalent precisely when g has unbound (i.e. _) rank. 

Since so many primitive, and almost all compound, verbs have unbound rank, f at g is correspondingly frequently equivalent to [: f g .

  2. If you’re going to memorize a rule to keep you out of trouble, I would phrase it:  [: f g and f@:(g)  — with the parentheses! — are equivalent. 

That way, for example, you won’t get tripped up by the difference between  [: *: +/  and  *: @: +/  which are _not_ equivalent.  But  [: *: +/  and  *: @: (+/)  — with parentheses around g! — are.

-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



More information about the Programming mailing list