Dimiter "malkia" Stanev a écrit : >> Or maybe just: >> (defn mo [op & args] (reduce op args)) >> > > I believe that won't make clojure make a faster code, but I might be > wrong. > I think the macroexpansion is the right thing if you want speed, as it > seems clojure could optimize well this: > > (+ a b) > > while it can't optimize this well > > (+ a b c) > > if a, b, c are say floating point numbers. >
You're right: Clojure currently only defines an inline expansion of (+ x y), other arities aren't inlined. Christophe -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
