The 'and' special form evaluates a sequence of expressions and returns the effect of a logical AND on the expressions. If, at any point, an expression is NIL, NIL is returned as the result of the 'and' function. If all of the expressions have a non-NIL value, the value of the last expression is returned as the result. Evaluation of the expressions will stop when an expression evaluates to NIL, none of the subsequent expressions will be evaluated. If there are no expressions, 'and' returns T as its result.
(and T "boo" "hiss" T "rah") ; returns "rah" (and T T T T) ; returns T (and) ; returns T (and (princ "hi") NIL (princ "ho")) ; prints hi and returns NIL (and (princ "hi") (princ " de ") ; prints hi de ho (princ "ho")) ; returns "ho" (setq a 5) (setq b 6) ; set up A and B (if (and (numberp a) ; if A is a number (numberp b) ; and B is a number (< a b) ) ; and A<B (print "A is less than B") ; THEN do this (print "something else happened")) ; ELSE do this ; prints "A is less than B"
See the