On 3/30/07, Terrence Brannon <[EMAIL PROTECTED]> wrote:
Part 8/13 of Lab: An Introductory Course in J has this code:
myverb =: dyad : '2 * x >. y'"0 NB. Create a custom verb: double the larger'
I would like to know what the double quote mark and zero are doing
after the quoted expression. The tutorial did not explain this.
As others have pointed out, " is J's rank conjunction.
Ironically, in this particular example (taken by itself), you would
get the same result from myverb even without "0. This is because
every verb used in myverb's definition is a rank 0 verb.
Because of this issue, that "0 only makes a difference in contexts
where myverb gets combined with some other verb which has a
larger rank. For example:
myverb2=:dyad :'2*x>.y'
1 2 3 <@myverb 3 2 1
+-+-+-+
|6|4|6|
+-+-+-+
1 2 3 <@myverb2 3 2 1
+-----+
|6 4 6|
+-----+
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm