Pass specific function as argument


#1

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?


#2

There’s only one function. Just only call it with ::Int.


#3

I don’t understand your answer.

I would like to pass f(::Int) such that g(f) = f(1.0) fails.


#4

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)