I literally asked this same question yesterday in #Clojure. The answer is and
user/ (doc and) ------------------------- 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. nil user/ (and true false) false user/ (and false true) false On Feb 10, 9:43 pm, Onorio Catenacci <catena...@gmail.com> wrote: > On Feb 10, 10:14 pm, Jeffrey Straszheim <straszheimjeff...@gmail.com> > wrote: > > > This one is easy: > > > (and this that the-other-thing) > > > and is short-circuting, e.g. it returns nil/false on reaching the first > > nil/false element, or the value of the last element. > > > I used it tonight like this: > > > (and x (inc x)) > > > This returns x+1, unless x is nil, in which case it returns nil. > > > Make sense? > > Yes, perfect sense. Seems so bloody obvious now--don't know why I > never thought to look for (and) on the Clojure website. Thanks for > the assist. > > -- > Onorio Catenacci III --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---