>
>
> It seems odd that [1; 2] != [1 2]'; typeof shows the former is 
> 1-dimensional and the latter 2-dimensional (if I'm interpreting 
> correctly), but that seems kind of inconsistent. 
>

A similar issue with indexing surprised me recently. If A is a 2-d array, 
A[:, 1] is a 1-d array but A[1, :] is a 2-d array.  The behavior you 
pointed out can sort of be deduced from concatenation 
<http://julia.readthedocs.org/en/latest/manual/arrays/#concatenation> 
section of the multi-dimensional arrays part of the manual, and the 
indexing behavior is in the indexing section 
<http://julia.readthedocs.org/en/latest/manual/arrays/#indexing>.  
("Trailing dimensions indexed with scalars are dropped.")

Maybe those points should be emphasized in the manual.

By the way, [1; 2] does happen to equal [1 2]' because [1 2]' reshapes [1 
2] to a 2x1 array. However, [1; 2]' != [1 2].

Reply via email to