clojure.core/and¶
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.
Examples¶
Note by huahaiy¶
Note add is a macro, so you cannot apply it. For example, there is a vector of some Boolean values [true true false true], which you want to test to see if they are all true. The code below will not work:
(apply add [true true false true]) ;won't workInstead, use this:
(every? identity [true true false true])More discussion can be found at http://osdir.com/ml/clojure/2010-01/msg01242.html
Note by dilipd¶
typo: 'and' instead of 'add'?
See also¶
- clojure.core/or (2)
- clojure.core/if (2)
- clojure.core/every-pred (2)
Content from the matching ClojureDocs page, with authors credited on each contribution.