Previous Page
Next Page

15.3. Boolean Operators

The boolean operators implement the basics of logic, working on boolean operands to produce a boolean result. The second operand, but not the first, will be coerced from a string or an integer, or a list of one string or one integer, to a boolean. Either operand will be coerced from a list of one boolean to a boolean.

and

logical and

logical and

Syntax

boolean1 and boolean2

Description

Returns TRue if both operands are true. If the first operand is false, the second operand won't even be evaluated ("short-circuiting").

or

logical or

logical or

Syntax

boolean1 or boolean2

Description

Returns false if both operands are false. If the first operand is true, the second operand won't even be evaluated ("short-circuiting").

not

logical not

logical not

Syntax

not boolean

Description

Changes true to false and false to true.


Previous Page
Next Page