I think I got it, (not sure how kosher it is)
julia> function eltype( x::(DataType,) )
fst = x[1]
if fst.name.name == :Vararg
return fst.parameters[1]
else
return fst
end
end
julia > eltype( (Int..., ) )
Int64
On Wednesday, November 12, 2014 5:00:04 AM UTC+7, Tony Fong wrote:
>
> When I have a tuple type of the form
> julia> dt = (Int...,)
> (Int64...,)
>
> julia> eltype(dt)
> Any
>
> How do I extract Int64 from that tuple of that form?
>
> I was hoping I could borrow ideas from reflection.jl:
> eltype{T}(x::(T...)) = T
>
> which works for values, like eltype( (1,2,3,4,5) ) -> Int, but I couldn't
> make it work for actual ... inside x.
>