and

macrosince v0.0-927 clojure.core/andEdit
(and)
(and x)
(and x & next)

Details:

Evaluates arguments one at a time from left to right. If an argument returns logical false (nil or false), and returns that value and doesn't evaluate any of the other arguments, otherwise it returns the value of the last argument.

(and) returns true.


Examples:

(and)
;;=> true

(and false)
;;=> false

(and true)
;;=> true

(and true true)
;;=> true

(and true false)
;;=> false

(and false false)
;;=> false

nil and false are the only falsy values and everything else is truthy:

(and "foo" "bar")
;;=> "bar"

(and "foo" nil)
;;=> nil

(and "foo" false)
;;=> false

(and nil "foo")
;;=> nil

(and false "foo")
;;=> false

See Also:


Source docstring:
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.
Source code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro and
  ([] true)
  ([x] x)
  ([x & next]
   (core/let [forms (concat [x] next)]
     (if (every? #(simple-test-expr? &env %)
           (map #(cljs.analyzer/no-warn (cljs.analyzer/analyze &env %)) forms))
       (core/let [and-str (core/->> (repeat (count forms) "(~{})")
                            (interpose " && ")
                            (#(concat ["("] % [")"]))
                            (apply core/str))]
         (bool-expr `(~'js* ~and-str ~@forms)))
       `(let [and# ~x]
          (if and# (and ~@next) and#))))))