BERKELEY LOGO 6.0: 5. Logical Operations

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 5. Logical Operations

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### and

    AND tf1 tf2
    (AND tf1 tf2 tf3 ...)

outputs `TRUE` if all inputs are `TRUE`, otherwise `FALSE`. All inputs must be `TRUE` or `FALSE`. (Comparison is case-insensitive regardless of the value of `CASEIGNOREDP`. That is, `true` or `True` or `TRUE` are all the same.) An input can be a list, in which case it is taken as an expression to run; that expression must produce a `TRUE` or `FALSE` value. List expressions are evaluated from left to right; as soon as a `FALSE` value is found, the remaining inputs are not examined. Example:

    MAKE "RESULT AND [NOT (:X = 0)] [(1 / :X) > .5]

to avoid the division by zero if the first part is false.

See section caseignoredp .

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### or

    OR tf1 tf2
    (OR tf1 tf2 tf3 ...)

outputs `TRUE` if any input is `TRUE`, otherwise `FALSE`. All inputs must be `TRUE` or `FALSE`. (Comparison is case-insensitive regardless of the value of `CASEIGNOREDP`. That is, `true` or `True` or `TRUE` are all the same.) An input can be a list, in which case it is taken as an expression to run; that expression must produce a `TRUE` or `FALSE` value. List expressions are evaluated from left to right; as soon as a `TRUE` value is found, the remaining inputs are not examined. Example:

    IF OR :X=0 [some.long.computation] [...]

to avoid the long computation if the first condition is met.

See section caseignoredp .

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### not

    NOT tf

outputs `TRUE` if the input is `FALSE`, and vice versa. The input can be a list, in which case it is taken as an expression to run; that expression must produce a `TRUE` or `FALSE` value.

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by Brian Harvey on September, 3 2008 using texi2html 1.78.