and is also written as a macro to short circuit evaluation: clojure.core/and ([] [x] [x & rest]) Macro Evaluates exprs one at a time, from left to right. If a form returns logical false (nil or false), and returns that value and doesn't evaluate any of the other expressions, otherwise it returns the value of the last expr. (and) returns true.
On Fri, Jan 16, 2009 at 10:49 AM, CuppoJava <[email protected]> wrote: > > I'm also very interested in this topic. > > The only reason to write "and" as a macro is for performance reasons. > It's much more convenient, programming-wise, if and is a function. > > Is there anyway to write a macro/function that acts as a function when > necessary (so it can be passed as an argument), but expands into a > macro (for speed) when deemed possible? > > > -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
