3.1.4 Booleans
3.1.4.1 Boolean Functions
Returns true when given false and vice versa.
check: not(true) is false not(2 < 1) is true end
3.1.4.2 Boolean Operators
The and operator “short-circuits”: if left evaluates to false, then right is not evaluated at all and the result is false.
examples: true and true is true true and false is false false and true is false false and false is false (4 < 5) and ("a" == "b") is false (4 < 5) and ((4 + 2) == 6) is true (4 > 5) and ((4 + 2) == 6) is false end
The or operator “short-circuits”: if left evaluates to true, then right is not evaluated at all and the result is true.
examples: true or true is true true or false is true false or true is true false or false is false (4 < 5) or ("a" == "b") is true (4 < 5) or ((4 + 2) == 6) is true (4 > 5) or ((4 + 2) == 6) is true (4 > 5) or ("a" == "b") is false end