User Tools


Macro OR

Syntax

  • or form*result*''

Arguments and Values

  • form - a form.
  • results - the values or primary value (see below) resulting from the evaluation of the last form executed or nil.

Description

or evaluates each form, one at a time, from left to right. The evaluation of all forms terminates when a form evaluates to true (i.e. something other than nil).

If the evaluation of any form other than the last returns a primary value that is true, or immediately returns that value (but no additional values) without evaluating the remaining forms. If every form but the last returns false as its primary value, or returns all values returned by the last form. If no forms are supplied, or returns nil.

Examples

(or)

NIL

(defvar *temp0* nil)

*TEMP0*

(defvar *temp1* 10)

*TEMP1*

(defvar *temp2* 20)

*TEMP2*

(defvar *temp3* 30)

*TEMP3*

(or *temp0* *temp1* (setf *temp2* 37))

10

*temp2*

20

(or (incf *temp1*) (incf *temp2*) (incf *temp3*))

11

*temp1*

11

*temp2*

20

*temp3*

30

(or (values) *temp1*)

11

(or (values *temp1* *temp2*) *temp3*)

11

(or *temp0* (values *temp1* *temp2*))

11 20

(or (values *temp0* *temp1*) (values *temp2* *temp3*))

20 30

Side Effects

None.

Affected By

None.

Exceptional Situations

None.

See Also

Notes

None.