A 1-element vector is different from a scalar.  The conformability
requirements for + are that either the left and right shapes match, or one
shape is a prefix of the other.  (,4) and (,1), the shapes here, do not
match and neither is a prefix of the other.  Hence the length error.



On Sat, Oct 22, 2016 at 1:58 PM, Skip Cave <[email protected]> wrote:

>    a =: 2 1 3 4
>
>    5 5 5 5 + 0{a
>
> 7 7 7 7
>
>    5 5 5 5 + 1{.a
>
> |length error
>
> | 5 5 5 5 +1{.a
>
>    1{.a
>
> 2
>
>     $ 1{.a
>
> 1
>
>    datatype a
>
> integer
>
>    datatype 5 5 5 5
>
> integer
>
>    datatype 1{.a
>
> integer
>
>
>
> Why the length error?
>
> Skip
>
> Skip Cave
> Cave Consulting LLC
> ----------------------------------------------------------------------
> 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