On 31.12.2008, at 17:56, Rich Hickey wrote: >> Does the Clojure compiler calculate the constant expression (. Math >> log 0.5) once, or at every function call? > > Every call. Clojure does not know that Math/log is a pure function.
OK, then I'll use this near-trivial macro: (defmacro const "Evaluate the constant expression expr at compile time." [expr] (eval expr)) >> Can I check this somehow, >> i.e. look at the generated code, with reasonable effort? > > Currently there is no bytecode dump facility, but Java bytecode tools > should work on AOT compiled class files. I'll look at those one day; at the moment my knowledge of the JVM is still near zero... Wishing a great 2009 to Clojure and to everyone on this list, Konrad. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---