Thank you both Ric and Brian. I never knew you could insert a colon to distinguish which verb J should use depending on monad/dyad arguments.
The sort verb makes much more sense to me now. On Sun, Jun 28, 2009 at 8:48 PM, Sherlock, Ric<[email protected]> wrote: >> From: Ian Gorse >> >> I just been looking at the 'sort' verb to understand how its done. >> >> sort >> /:~ :/: >> >> I don't understand why the ':/:' is there for as >> sort2=: /:~ >> sort2 9 8 7 6 3 >> 3 6 7 8 9 >> >> produces correct results on all my simple test cases. > > Might be clearer with an extra space: > sort=: /:~ : /: > > the middle colon is the conjunction Monad/Dyad > www.jsoftware.com/help/dictionary/d310v.htm > > /:~ is used where sort is given only a right argument (the monadic case) > /: is used for the dyadic case where the right argument gives the sort order > & the left argument the array to be sorted. > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
