I'd replace ([ * 1 - ]) with (* -.) .
As previously observed, 13 :'quoted expression' won't write hooks.

   (([ * 1 - ]) -: (* -.)) -:i:8     NB. monad
1
   (([ * 1 - ])/ -: (* -.)/)~ -:i:8  NB. dyad
1
   
>Date: Sun, 19 May 2013 11:43:52 -0400
>From: "Linda Alvord" <[email protected]>
>To: <[email protected]>
>Subject: Re: [Jprogramming] newbie help: how to avoid division by zero
>Message-ID: <000101ce54a7$aa2d4c10$fe87e430$@net>
>Content-Type: text/plain; charset=US-ASCII
>
> It is worth noting further simplification by J:
>
>   veco=: 13 :'(c*1+3*y) + (halve y) * (1-c =. odd y)' 
>   veco
>halve (* + [ * 1 - ]) odd
>   
>Linda


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

Reply via email to