ClojureCLR v2.15 Release Notes
-
:const lets you name primitive values with speedier reference.
(def constants {:pi 3.14 :e 2.71}) (def ^:const pi (:pi constants)) (def ^:const e (:e constants))
The overhead of looking up :e and :pi in the map happens at compile time, as (:pi constants) and (:e constants) are evaluated when their parent def forms are evaluated.