size(x,n) apparently works to arbitrary n. I don't think this is
intentional, because the C implementation includes a dimension check (this
call goes through codegen even at the REPL).


On Wed, Aug 13, 2014 at 4:54 PM, Dominique Orban <[email protected]>
wrote:

> I'm wondering if the following behavior is intentional and what the
> rationale is:
>
> julia> x = rand(5);
>
> julia> size(x)
> (5,)
>
> julia> n = size(x,1)
> 5
>
> julia> m = size(x,2)
> 1
>
> julia> (n, m) = size(x)
> ERROR: BoundsError()
>
> I would expect either both size(x,2) and (n,m) = size(x) to work and be
> consistent, or both to return the same error...
>
>

Reply via email to