And would it be possible to determine this statically?
An example of what I want
julia> f = x -> x
#5 (generic function with 1 method)
julia> applicable(f, 0)
true
julia> applicable(f, 0, 0)
false
From this, I may determine that the function has a method that accepts one argument, but doesn’t accept two (in my case, it’s really a choice between 1 vs many arguments). Would it be possible to determine this statically, without actually trying out combinations?
This is used internally in ApproxFun to determine whether to splat arguments while passing them to the provided function, and I’m trying to see if such an approach may be improved.
I doubt that it’s a good idea, but I’m unsure how it’s used internally, so I’m not brave enough to make sweeping changes. Thanks for your suggestion, seems quite reliant on internals TBH, but I’m unsure if there’s any other way.