Re: [ANN] 'primitive-math', a library for predictable arithmetic operations

2013-06-07 Thread Ambrose Bonnaire-Sergeant
FWIW a third option to determine the exact method called is jvm.tools.analyzer: clojure.tools.analyzer=> (clojure.pprint/pprint (ast (+ 1 2))) {:op :static-method, :env {:source "NO_SOURCE_FILE", :column 29, :line 1, :locals {}, :ns {:name clojure.tools.analyzer}}, :class clojure.lang.N

[ANN] 'primitive-math', a library for predictable arithmetic operations

2013-06-07 Thread Zach Tellman
What (+ x y) compiles down is highly dependent on the surrounding context, including but not limited to the local type-hints and the value of *unchecked-math*. Actually verifying that it's calling the primitive, unboxed, easily inlined clojure.lang.Numbers.add(long, long) requires either a pro