next up previous
Contents Next: append (FUNCTION) Up: Appendix: Selected LISP Previous: <>, <=,

and (MACRO)

Format: (and <exp1> <exp2> ... <expN>)

Required arguments: None

This macro evaluates its arguments in order until it reaches a nil value, in which case it returns NIL, or it returns the value of <expN>. Evaluation of intermediate expressions may produce side-effects. In the special case where and is given no arguments, it always returns T.

Examples:

>(and 3 (+ 4 5))
9

>(and nil (print 'hello))
NIL

>(and t (print 'hello) 3)

HELLO 
3

>(and)
T



© Colin Allen & Maneesh Dhagat
November 1999