When I build an array using a comprehension as follows:

        a = [i for i=1:3]

its type is 3-element Array{Int64,1}.


However, when I build a second array as:

        b = [a[i] for i=1:3]

its type is 3-element Array{Any,1} instead of Array{Int64,1}.


How can I build b so that it preserves the type of a?

Reply via email to