The key difference between the two expressions is that ( c ) is a noun
and ( 2&{"1@] ) is  a verb

   d=: 2&{"1@]
   type ;:'c d'
┌────┬────┐
│noun│verb│
└────┴────┘

So the form of amend you are using is different in the two cases ( m}
) cf ( u} ).
You get an index error using ( c ) because it is interpreting the
integers in ( c ) as indicies of ( a ) and ( a ) doesn't have matching
items for some of the big numbers in ( c ).

On Sat, May 19, 2012 at 11:30 AM, Robert Cyr <robert....@gmail.com> wrote:
> Inserting a 2 column array in a specified  column of a rank 3 array.
>
> *Given*:
>
>   a=.i.2 3 5
>   b=.i.2 3
>   ]c=.2{"1 a
>  2  7 12
> 17 22 27
>
> *This one is fine:*
>
>   b(2&{"1@])}a
>  0  1 0  3  4
>  5  6 1  8  9
> 10 11 2 13 14
>
> 15 16 3 18 19
> 20 21 4 23 24
> 25 26 5 28 29
>
> *But not this quite similar one*:
>   b c }a
> |index error
> |   b     c}a
>
> *Why?*
>
>
> Sent from my iPad
> ----------------------------------------------------------------------
> 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