Could you just explain what these two lines are actually doing:
guidance 1!:2 (2)
guidance is a noun - in this case a text with embedded line feeds
1!:2 is the foreign conjunction !: (It has arguments 1 for file operations
and 2 a write - so the verb it creates writes the left argument to the
file defined by the right argument.
(2) is the file which is the screen
mydata =. 0 : 0
This statement defines a noun. It is called within the function. Again
it uses a conjunction :
It uses the Explicit form to define a noun (the 0 on the left) and
expects input from a script which is specified as 0 on the right.
The 0 indicates input will be taken from the keyboard. An Enter
generates a line feed and a right parenthesis after an Enter indicates
termination of the script being input.
The expression 3 : 0 in the verb definitions can be replaced by
the words verb define
and the expression 0 : 0 can be replaced by the words noun define.
Using verb define within a function also works but must include
references to the arguments of the local verb which is being defined.
Fraser
I see that guidance is defined as just a print statement prompt, but what
is
the 1!:2(2) business about?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm