bool
type bool
Source: compiler/src/builtin_docs/types.hy A boolean: true or false.
Conditions in if and while take a bool. && and || short-circuit;
! negates (it also accepts an int, where 0 is false). Booleans
support == and != but are not ordered.
Casts with as: bool as int is 1 or 0; int as bool is true for
any non-zero value.
Examples#
use tests::assert;
let ready = 3 > 2 && !false;
assert!(ready);
assert!(true as int == 1);
assert!(!(0 as bool));
assert!(show(ready) == "true");