Oleg wrote:
>using the verb form.
> '0' I.@:=&' '@]} ' 5\ 3\2004'
Be careful with this; this form is not documented properly [1]. The indices
produced by the verb in verb} y and x verb} y are into /the ravel/ of y.
Vide:
'x' 2 } > ;: 'aaa bbb ccc ddd'
aaa
bbb
xxx
ddd
'x' 2:} > ;: 'aaa bbb ccc ddd'
aax
bbb
ccc
ddd
'xyz' 2 } > ;: 'aaa bbb ccc'
aaa
bbb
xyz
'xyz' 2:} > ;: 'aaa bbb ccc'
|rank error
| 'xyz' 2:}>;:'aaa bbb ccc'
(Note that 2 is a noun and 2: is a verb)
Of course, the ravel of a rank-1 array is a no-op (i.e. the ravel of a vector
is the vector), so this isn't a problem in Matthew's use case (though I might
slap a "1 on his verb, prophylactically).
I personally would use ' '&=`(,:&'0')} ' 5\ 3\2004' , but that's a matter of
taste.
-Dan
[1] http://www.jsoftware.com/jwiki/System/Interpreter/Bugs#verb_amend_spec
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm