Thank you for the solution and explanation ! Frederico.
On Tuesday, July 22, 2014 11:40:24 AM UTC-3, Ivar Nesje wrote: > > You must use push! > > Julia is very careful about the meaning of a function (partially because > multiple dispatch makes it much more important than in other languages). > > push! : appends a single element to a collection > append! : pushes all the elements of a container into another container. > > c_zero is an array of arrays, and thus you will have to insert the whole > array [1,2] into c_zero, not all the elements of the array. > > Ivar > > kl. 16:17:19 UTC+2 tirsdag 22. juli 2014 skrev Frederico Novaes følgende: >> >> Hi, >> >> I started using Julia last week, so newbie. Here is the issue I'm having: >> >> - I want to store a certain unknown number of elements like [1,2] ( type >> Array{Int64,1} ). >> >> - I first create an array to store them, using: >> >> julia> c_zero = Array(Array{Int64,1},0) >> >> - But then, when I try to append! a new element, I get an error: >> >> julia> append!(c_zero,[1,2]) >> >> MethodError(convert,(Array{Int64,1},1)) >> >> >> Thanks for any help. >> >> Frederico. >> >> >> >> >>