Skip to content
Konjure / spatial intelligence
Browse docs

Bool

← Builtin reference

A Boolean value used by conditions and short-circuit expressions.

Signature

Bool stores a Rust bool and has exactly two values: true and false. if and while require Bool; numeric zero and empty collections do not act as false. and and or evaluate their right side only when needed.

Examples

Combine conditions

The right side of and is skipped when ready is false.

More
Tick 0 · 0.00 s⌘ / Ctrl + Enter
main.kj
Results
Loading the language runtime…
Output 0
No output.
Expected output
false
true

Rust definition

Value::Bool(bool); conditions never coerce numbers or strings.

See also