Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

user> (def f (fn (link: ^long x) x))

'user/f

user> (.invokePrim (with-meta f {}) 1)
IllegalArgumentException No matching method found: invokePrim for class clojure.lang.AFunction$1 clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:53)
user> (contains? (ancestors (class f)) clojure.lang.IFn$LO)
true
user> (contains? (ancestors (class (with-meta f {}))) clojure.lang.IFn$LO)
false

We're working on libraries that use metadata on functions to track information about their arguments (schemata, etc), and this currently blocks us from fully supporting primitive fns.

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1198 (reported by jawolfe)
...