f2a=:(1:`[`(0$~]))}
   3 5 7 f2a 10
0 0 0 1 0 1 0 1 0 0

R.E. Boss


> -----Oorspronkelijk bericht-----
> Van: [email protected] [mailto:programming-
> [email protected]] Namens Steven Taylor
> Verzonden: zaterdag 9 april 2011 16:48
> Aan: Programming forum
> Onderwerp: [Jprogramming] forms of ammend
> 
> f=:13 : '1 (x)}y$0'
>     3 5 7 f 10$0
> 0 0 0 1 0 1 0 1 0 0
> (correct)
> 
> but
>    f2=:1([)}0$~]
>    3 5 7 f2 10
> 0 1 0 0 0 0 0 0 0 0
> I can see that there are some challenges from the boxed notation returned
> for f2... but wondered if there was a way to achieve this tacitly.  I'm
guessing,
> but f looks like it is less efficient because it resolves to 4:1 (x)}y$0.
i.e.
> interpret a string on-the-fly.
> 
> thanks,
> -Steven
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

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

Reply via email to