You should then use memoize explicitly then. Of course, avoid this if you have side effects in the function.
Luc > In its optimization, does the Clojure compiler ever assume idempotency? That > is, does it ever look at a function application `(f x y z)` and say to itself > "I may freely substitute the result of the first application of `f` to those > particular arguments for any later call"? > > I could imagine it doing that for built-ins (or just primitives?), but not > for user-defined functions (given the existence of atoms, etc.) I can also > imagine it not bothering for any calls. > > ----- > Brian Marick, Artisanal Labrador > Contract programming in Ruby and Clojure > Occasional consulting on Agile > > > -- > 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 > Note that posts from new members are moderated - please be patient with your > first post. > 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 > -- Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad! -- 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 Note that posts from new members are moderated - please be patient with your first post. 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