For some reason, I remember there was an easier way to get an adverb to notice 
whether it had an m or u parameter, but I can't recall if that was the case, or 
how to do it.  Is there an easier way to write the adverb below?

isNoun =: (0 = 4!:0 ( :: 0:))@:<


   2 (1 : 'if. isNoun ''u'' do. u else. u y end.') 3
2
   +: (1 : 'if. isNoun ''u'' do. u else. u y end.') 3
6
   '+: y' (1 : 'if. isNoun ''u'' do. (3 : u) y  else. u y end.') 3
6

   '+: y' (1 : 'if. isNoun ''u'' do. u =. (13 : u) end.  u ') 3  NB. TIL you 
can add code after 'end.' on same line.
6

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

Reply via email to