type: special form (fsubr) location: built-in source file: xlcont.c Common LISP compatible: yes supported on: all machines
(or [ <expr1> ... ] ) <exprN> - an expression
The OR special form evaluates a sequence of expressions and returns the effect of a logical INCLUSIVE-OR operation on the expressions. If all of the expressions are NIL, NIL is returned as OR's result. Evaluation of the expressions will stop when an expression evaluates to something other than NIL, none of the subsequent expressions will be evaluated. If there are no expressions, OR returns NIL as its result.
(or NIL NIL NIL) ; returns NIL (or NIL T NIL) ; returns T (or NIL (princ "hi") (princ "ho")) ; prints hi and returns "hi" (or T T T) ; returns T (or) ; returns NIL ; (setq a 5) (setq b 6) ; set up A and B (if (or (< a b) (< b a)) ; if (print "not equal") ; then (print "equal")) ; else ; prints "not equal"