On Mon, Jul 6, 2015 at 1:26 PM, Jacob Quinn <[email protected]> wrote: > http://docs.julialang.org/en/latest/stdlib/base/#Base.applicable
I don't think applicable is doing anything better than method_exists. To do exactly what you are saying, you should just iterate all defined methods (which you can get with `methods`) and check the signature of the method (which is available as meth.sig IIRC) although you might hit a bug when comparing TypeVars.... (and somehow I couldn't find the bug report for this) It is quite strange that you would need this for anything other than debuging. Could you describe what exactly do you want to do? > > On Mon, Jul 6, 2015 at 11:25 AM, Simon Byrne <[email protected]> wrote: >> >> If I have a generic method foo, is there a way I can tell if a particular >> signature has been defined? >> >> Note that I don't want method_exists (which simply determines if something >> can be dispatched), I want to determine if a particular definition has been >> made, e.g. if >> >> foo(x) = x >> >> then I want >> >> method_defined(foo,(Int,)) == false >> method_defined(foo,(Any,)) == true >> >> >> >
