or ( obj1 obj2 -- ? )
Factor handbook > The language > Booleans

Prev:and ( obj1 obj2 -- ? )
Next:xor ( obj1 obj2 -- ? )


Inputs and outputs
obj1a generalized boolean
obj2a generalized boolean
?a generalized boolean

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

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.

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 .

USING: kernel prettyprint ; "hi" 12.0 or .


: or ( obj1 obj2 -- ? ) dupd ? ; inline