Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

or

or

type: special form (fsubr)
location: built-in
source file: xlcont.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(or  [ <expr1> ... ] )
        <exprN>         -       an expression

DESCRIPTION

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.

EXAMPLES

(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"


Go to the first, previous, next, last section, table of contents.