---Sherlock, Ric wrote:
> ---David Vincent-Jones wrote:
> > I am having problems correctly replacing in this context:
> > abc =:i.2 2 3
> >    [c=: 2{ "1 abc
> > 2  5
> > 8 11
> >    c2=:c*2
> > Now, how do I get c2 to replace c? (with some elegance)
> > I do have a very ugly workaround that I dare not show.
>
>    c2 2}"0 1 abc    NB. x m}y
>    (+: 2{"1 abc) 2}"0 1 abc  NB. x m}y
>    2 (+:@{"1`2:`])}"1 abc  NB. Gerund form
>    2 (+:@{"1`[`])}"1 abc   NB. Gerund form

Another option:
   c2 (<a:;a:;2)} abc
0  1  4
3  4 10

6  7 16
9 10 22
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to