Hi,

   ;: '999 9 } s'
┌─────┬─┬─┐
│999 9│}│s│
└─────┴─┴─┘

   ;: '999 (9) } s'
┌───┬─┬─┬─┬─┬─┐
│999│(│9│)│}│s│
└───┴─┴─┴─┴─┴─┘


As demonstrated by using ;: above, the version without parentheses parses
999 9 as a single array.

Cheers,

Raoul

Le lun. 22 juin 2020 à 20:33, HH PackRat <hhpack...@gmail.com> a écrit :

> This is based on some exemplary amend code I found somewhere (but
> don't remember where):
>
>    ]s=. i.12
> 0 1 2 3 4 5 6 7 8 9 10 11
>
> This example of multiple indexes works:
>
>    ]s1=. 999 (1 5 9) } s
> 0 999 2 3 4 999 6 7 8 999 10 11
>
> but this seemingly simpler version (appearing exactly the same as the
> amend form x m} y) does NOT work:
>
>    ]s1=. 999 9 } s    ( or: ]s1=. 999 9} s )
> |rank error
> |   ]s1=.    999 9}s
>
> However, if the single m value is surrounded by parentheses (which is
> nowhere stated in the amend definition x m} y), then it DOES work:
>
>    ]s1=. 999 (9) } s
> 0 1 2 3 4 5 6 7 8 999 10 11
>
> What am I not understanding here?  Thanks for any explanations.
>
> Harvey
> ----------------------------------------------------------------------
> 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