thanks!
On Sunday, 24 May 2015 16:32:43 UTC-3, Yichao Yu wrote: > > On Sun, May 24, 2015 at 3:13 PM, andrew cooke <and...@acooke.org > <javascript:>> wrote: > > > > Is there a simple way, in 0.4, given the type of a tuple, to know how > many > > entries it has? > > > > When types of tuples were themselves tuples you could just use length, > but > > that no longer works. > > ``` > julia> typeof((1, 2, 3)) > Tuple{Int64,Int64,Int64} > > julia> typeof((1, 2, 3)).parameters > svec(Int64,Int64,Int64) > > julia> length(typeof((1, 2, 3)).parameters) > 3 > ``` > > works for other parametrized types as well. > > > > > (I don't have a desperately important use case, it's just the hacky way > I > > wrote some tests in some code I am bringing up-to-date) > > > > Thanks, > > Andrew > > >