When you use only one number as the right argument to rank ( " ) then that number is used for both the left and right ranks. IOW ( "0 ) is the same as ( "0 0 ) which is also the same as ( "0 0 0 ). You might want to use all three numbers to specify a different right rank for monadic usage than for dyadic usage. http://www.jsoftware.com/docs/help701/dictionary/d600n.htm Here is an expansion of Henry's hook as a fork. 17 24 35 ([ + [: i. ])"0 ]5
On Mon, Mar 25, 2013 at 9:59 AM, Alex Giannakopoulos <[email protected]> wrote: > Thanks Henry! > >>> 17 24 35 +"0 1 i. 5 > I can see that from the second example you provide that it was daft trying > to change the rank of i, since it is actually + that needs this > treatment. > I.e. I could have made a verb r0addr1 =: +"0 1 and done (17 24 35 > r0addr1 i.5). Cool. > >>> 17 24 35 (+ i.)"0 (5) > The parsing of your first example still eludes me though. I am assuming > that (+i.) is a hook, and that "0 applies not to both its arguments, but > to the right one only. > That would be interpreted, hm, let's see, x f (g y) IOW the > pseudo-expression (17 24 35) + (( i."0) (5)) > Of course the actual above expression doesn't work (length error) , but its > "sense" works, i.e. when written as a hook. > OK, I think I got that now... > > Is there a better way to rewrite the exact operation of that hook? One > that actually works, and makes the x f g y interpretation clear? > That is to say, am I getting anywhere here? > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
