or ( obj1 obj2 -- obj1/obj2 ) (original) (raw)

Vocabulary
kernel

Inputs

obj1 a generalized boolean
obj2 a generalized boolean

Outputs

obj1/obj2 a generalized boolean

Word description
If both inputs are false, outputs f. Otherwise outputs the first of obj1 and obj2 which is true.

Notes
This word implements boolean inclusive or, so applying it to integers will not yield useful results (all integers have a true value). Bitwise inclusive or is the bitor word.

Examples
Usually only the boolean value of the result is used, however you can also explicitly rely on the behavior that the result will be the first true input:

USING: kernel prettyprint ; t f or .
t

USING: kernel prettyprint ; "hi" 12.0 or .
"hi"

See also
or*, or?

Definition