On 23.01.2009, at 19:04, Stephen C. Gilardi wrote:

> is something that ultimately invokes "def". On the way to invoking  
> def, one could also allow compiling code, but not running it,  
> deferring initializers until some kind of "load" time. Macros  
> present a problem with this strategy, of course, and I gather  
> they're the primary reason why code has to be loaded as well as  
> compiled in Clojure's "same world" compilation process currently.

How about something like

(let [my-factor (* 3 (. Math sqrt 2) (. Math log 42.))]
   (defn foo [x] (* my-factor x)))

where the let outside of the definition makes sure the constant  
factor is evaluated only once?

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to