Next: , Previous: , Up: Expressions   [Contents][Index]

4.17.8 Boolean Expressions

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:

x and yTrue only if both x and y are true.
x or yTrue if any of x or y is true.
not xTrue if x is false.

table 4.1: Boolean Operators

Binary boolean expressions are computed using shortcut evaluation:

x and y

If xfalse, the result is false and y is not evaluated.

x or y

If xtrue, the result is true and y is not evaluated.