I need to somehow tag certain Clojure functions as "special" so that Java code could recognize them as such using reflection. I've tried to add an annotation to a function, but apparently that's not supported. I've tried to reify
an interface extending IFn
(so that the Java code could recognize the function object), but that's no good because Clojure doesn't directly use the reified method as the code implementing invoke
, but rather an indirect call to an Afunction
object that's actually implementing the method (I need to tag the actual invoke
method with the actual function code).
Any ideas?
EDIT: even tagging in a way that could be accessed with the ASM library (rather than regular reflection) would be fine, but I need to somehow tag the actual AFunction
object or the invoke
method. Also, I can't access the actual AFunction
object -- I need the tag to be visible on the class.