On Tue, Feb 4, 2014 at 10:22 AM, Raul Miller <[email protected]> wrote:
> Let me know if you want any explanation of either this variant or of
> the variant at
http://jsoftware.com/pipermail/programming/2014-February/034884.html
> - questions can help.

Thanks, but it was pretty readable. :)  Once I understood `:6 I tried
recreating your solution without looking a couple times, and it makes sense
to me now.

Here's a variant that lets you express logical negation of the condition a
bit more naturally:

   unless =: 2 : 'u"_`(v"_)'  NB. exactly the same as 'if'
   then =: 2 : 'v"_`(0{m)@.([: -. (1{m)`:6)'

   (] unless (e. & 1 3) then _)"0  i.5
0 _ 2 _ 4
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to