if
Execute a block when its condition is true.
if condition { ... } else { ... }Runs the first block when the condition is true, otherwise the optional else block. Inside compiled functions, else if chains further conditions.
Example
if count > 0 { print "ready" } else { print "empty" }Syntax
<condition:expr> <accepted:block> [else <rejected:block>]Example
if count > 0 { print count }Arguments
- —
- : —
- accepted — Code executed when the condition is true.
- condition — An expression interpreted as true or false.
- rejected — Optional else block executed when the condition is false.