Closed malmaud closed 9 years ago
Tnx! Yes, that does make sense. To be callable this should work:
@traitdef IsCallable{X} begin
@constraints begin
X==Function || length(methods(call, (A,)))>0
end
end
or are there other cases?
I think that should do it.
Cool, I'll probably put that into https://github.com/mauro3/SimpleTraits.jl/blob/master/src/base-traits.jl. The idea is that Traits.jl is built on top of SimpleTraits.jl.
Closed in favor of https://github.com/mauro3/SimpleTraits.jl/issues/1
I love this package!
I was wondering if it would make sense to have a common trait corresponding to whether a type
T
is 'callable', in the sense that ifisa(x, T)
thenx(args...)
will work.