Next: Precedence, Previous: Special comparisons, Up: Expressions [Contents][Index]
A boolean expression is a combination of relational or
matching expressions using the boolean operators and
, or
and not
, and, eventually, parentheses to control nesting:
Expression | Result |
---|---|
x and y | True only if both x and y are true. |
x or y | True if any of x or y is true. |
not x | True if x is false. |
Binary boolean expressions are computed using shortcut evaluation:
x and y
If x ⇒
, the result is false
false
and y is not evaluated.
x or y
If x ⇒
, the result is true
true
and
y is not evaluated.