is there an easy way to convert a tuple to an array?
julia> a=(1,2,3)
(1,2,3)
julia> convert(Array, a)
no method convert(Type{Array{T,N}},(Int64,Int64,Int64))
in method_missing at /Users/martisak/devel/julia/j/base.j:58
in convert at /Users/martisak/devel/julia/j/base.j:3
Thank you!
Kind regards,
Martin
When you write [17, 4711.0] the 17 gets converted to Float64 upon construction of the array. That's not the case for tuples. One wants all([isa(x,eltype(c)) for x in c]) to hold for all collections, which would fail if the eltype of a tuple was what you're proposing. It might make sense to have eltype((17, 4711.0)) == Union{Int,Float64}, however, instead of Any.
I'd argue that tuples shouldn't even have an eltype defined.