Next: 6.7.5 The list type Up: 6.7 Operators Previous: 6.7.3 The character type Contents

## 6.7.4 The boolean type

The two boolean constants are written as `true` and `false`. Boolean values are generated by the relational operators. You can use the standard logical operators (`&&`, `||`, `!`). You can use a boolean type as an argument in an `if-then-else` expression.

As with C, the logical operators do not evaluate their right-hand sides if their value can be determined just from evaluating their left-hand sides.

> | `` | `` |  | `` | `` |  | `` | `` |  | `` | `` |  | `` | `` |  | `` | `` |  | `` | `` |  | `` |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
> | `true && false == false` |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
> | `true error "boink!" == true` |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
> | `if true then 12 else 13 == 12` |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |

Next: 6.7.5 The list type Up: 6.7 Operators Previous: 6.7.3 The character type Contents