Invoking an anonymous primitive function seems to not use the primitive interface.
(set! *unchecked-math* :warn-on-boxed)
(let [f (fn ^double [] 1.0)]
(+ 1.0 (f)))
;; Boxed math warning
Is this expected behaviour?Don't know, put it on ask please
it's at least very intentional in the compiler, invokePrim optimisations are only emitted for var callsites
https://ask.clojure.org/index.php/14888/invoking-anonymous-primitive-function-primitive-interface
The limitation to 4 arguments on primitive functions means itβs not always possible to use a defn instead.