Thing I learned today:

3 : '...' " 1

doesn't need parentheses.

A good way to learn that

foo =: 3 : 0
yada yada yada
) " 1

doesn't work is to try it. For example, I just tried:

  3 : 0 ] 2
y. + 10 NB. Yes, I'm attached to y.
)
12

and I learned something else.
------------------------------------------------------------------------
|\/| Randy A MacDonald   | APL: If you can say it, it's done.. (ram)
|/\| [EMAIL PROTECTED]  |
|\ | |If you cannot describe what you are doing BSc(Math) UNBF'83 |as a process, you don't know what you're doing. Sapere Aude | - W. E. Deming Natural Born APL'er | Demo website: http://156.34.82.146/
-----------------------------------------------------(INTP)----{ gnat }-

----- Original Message ----- From: "Fred Bone" <[EMAIL PROTECTED]>
To: "General forum" <[email protected]>
Sent: Tuesday, August 15, 2006 6:09 AM
Subject: Re: [Jgeneral] RE: [Jbeta] Possible link error in Dictionary


On 14 Aug 2006 at 12:10, Roger Hui said:

Do you understand the following?

sum =: +/
sum1=: +/"1

sum1 is defined to apply to the rank 1 cells of
the argument.  Now:

foo=: 3 : 0
 blah blah blah
)

foo1=: 3 : 0 " 1
 blah blah blah
)

The pattern regarding rank is the same between sum/sum1 and foo/foo1 . What is different is
that for (m : 0) , the lines of the object being
defined are taken from the following lines,
terminated by a ) on a line by itself.  It may be
helpful to compare the above to the following:

sum=: +/
sumEach=: +/&.>

foo=: 3 : 0
 blah blah blah
)

fooEach=: 3 : 0 &.>
 blah blah blah
)

OK, but given
 foo2 =. 3 : 'blah blah blah' "1 0
how is the novice to know that the construct with the : 0 form is not
 foo =: 3 : 0
 blah blah blah
 ) "1 0
?

"Terminated by ) on a line by itself" is a major clue, of course, but ISTM that an example somewhere obvious would be useful.

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


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

Reply via email to