clojure-dev 2026-01-13

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?

πŸ‘€ 1
Alex Miller (Clojure team) 2026-01-13T14:21:37.818549Z

Don't know, put it on ask please

πŸ‘ 1

it's at least very intentional in the compiler, invokePrim optimisations are only emitted for var callsites

The limitation to 4 arguments on primitive functions means it’s not always possible to use a defn instead.