I have defined two methods f(x::Int) and f(x::Float64)with different signatures. I would like to pass one of the two, say f(::Int) as the argument of another function, g(f::Function).
How can I do that in v0.5?
I have defined two methods f(x::Int) and f(x::Float64)with different signatures. I would like to pass one of the two, say f(::Int) as the argument of another function, g(f::Function).
How can I do that in v0.5?
There’s only one function. Just only call it with ::Int.
I don’t understand your answer.
I would like to pass f(::Int) such that g(f) = f(1.0) fails.
OK, so that’s the actual, question. The answer is still that there’s no way to do that since there’s only one function. You can just use an anonymous function x::Int->f(x)