Re: [julia-users] Inner constructor var args

2015-10-09 Thread Jason Merrill
Thanks Jameson. Here's what I ended up with: immutable NTSeries{N, T} coefficients::NTuple{N, T} NTSeries(a...) = new(a) end NTSeries(a...) = NTSeries{length(a), eltype(promote(a...))}(promote(a ...)...) NTSeries(1.0, 2.0) # NTSeries{2,Float64}((1.0,2.0)) NTSeries(1//2, 5) # NTSeries{2,Ra

Re: [julia-users] Inner constructor var args

2015-10-09 Thread Jameson Nash
Since you replaced the inner constructor with an explicit one, you also need to define an outer constructor. On Fri, Oct 9, 2015 at 7:13 PM Jason Merrill wrote: > I'm trying to make a wrapper around an NTuple that takes varargs, but I > can't figure out what the constructor should look like. I t

[julia-users] Inner constructor var args

2015-10-09 Thread Jason Merrill
I'm trying to make a wrapper around an NTuple that takes varargs, but I can't figure out what the constructor should look like. I thought the following would work, but it throws an error jwm@jason-2 ~/s/julia> julia _ _ _ _(_)_ | A fresh approach to technical computi