Reputation: 876
In Julia v0.4, the following two works:
Array{Tuple{Int, Int}}(10)
and
Array(Tuple{Int, Int}, 10)
Which is the better way? Is there any reason that one should be preferred to another?
I recognized that a previously working code
Array((Int, Int), 10)
no longer works in Julia v0.4. I am afraid that one of the above two currently working code also does not work in the future.
Upvotes: 2
Views: 1028
Reputation: 2543
From the docs, Array(T, dims)
is deprecated, so I would go with the first.
http://docs.julialang.org/en/release-0.4/stdlib/arrays/#Base.Array
Upvotes: 4