Re: [julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Chris Stook
That makes sense. I should have seen that. Thank you!

Re: [julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Yichao Yu
On Fri, Oct 7, 2016 at 4:05 PM, Chris Stook wrote: > Calling objects of type T is only valid if N arguments are provided. What > is the correct syntax for this? > > immutable T{N} > t :: NTuple{N,Any} > end > > (x::T)(args...) = error("wrong number of arguments")

[julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Chris Stook
Calling objects of type T is only valid if N arguments are provided. What is the correct syntax for this? immutable T{N} t :: NTuple{N,Any} end (x::T)(args...) = error("wrong number of arguments") function {N}(x::T{N})(args::Varargs{Any,N}) print("do stuff here") end syntax: invalid