I believe you have to first create an empty array, and then assign to each individual element.
If the outer array is small, then you can take a work-around via a tuple: collect(([1,2], [3,4])) -erik On Tue, Jan 5, 2016 at 2:28 PM, Alex <updates...@gmail.com> wrote: > Hello, > > How to construct without push! equivalent vector of vectors? > > a=[] > push!(a, [1,2]) > push!(a, [2,3]) > > it gives: > # 2-element Array{Any,1}: > # [1,2] > # [2,3] > > If i type > > a=[[1,2],[2,3]] > it gives me a 4-element array. -- Erik Schnetter <schnet...@gmail.com> http://www.perimeterinstitute.ca/personal/eschnetter/