The 'and' special form evaluates a sequence of expressions and returns
the effect of a logical AND on the expressions.
(and t t t) => T (and nil t) => NIL (and t nil) => NIL (and) => T
Some more practical examples:
> (and T "boo" "hiss" T "rah") "rah" ; return value of AND > (and (princ "hi") NIL (princ "ho")) hi ; prints "hi" NIL ; return value of ANDSee princ.
> (setq a 5 b 6) ; set up A and B
6 ; return value of SETQ
> (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 "error")) ; else do this
"A is less than B" ; screen output of PRINT
"A is less than B" ; return value of IF
See also: