jolin-io/IsDef.jl

Use tricks?

Closed this issue · 2 comments

I haven't tried Tricks.jl yet however from what I read on its README it adds to hasmethod in that it triggers recompilation if some method definition change. If I understood right.

IsDef.jl adds to hasmethod another direction, in that it does not check whether a function has a method, but whether the function is actually defined the whole way down for the input arguments.

Lets have an example

g(a::Int) = true
f(args...; kwargs...) = g(args...; kwargs...)
hasmethod(f, Tuple{String})  # True
using Tricks
static_hasmethod(f, Tuple{String})  # True
using IsDef
isdef(f, String)  # False

In this sense, Tricks.jl and IsDef.jl try to accomplish different tasks. Nevertheless a auto-recompilation feature like in Tricks.jl would be nice to have for IsDef.jl too.

After kind of 2 years, I finally made a complete rewrite of IsDef which now also uses Tricks (a slightly adapted version of its core idea) in a recursive manner.

Thank you very much for the pointer back then to Tricks