Control Flow

Parentheses and Braces

Curly braces { } are required for all control flow. The parentheses ( ) are optional.

For

for

While

while

Until

until

When

when

If

if

Ternary operator

ternary

Goto

goto

By default goto is disabled by the compiler. This can be enabled in build.toml.

goto_xkcd

From xkcd.

Continue and Break

continue_break

Labelled Blocks

labelled_blocks

Block Values

Blocks are expressions and can be used to get values.

Sometimes it's impracticle or not possible to initialize/set a variable in one line. Using blocks can prevent needing to set the variable to undefined or a temporary value.

Blocks can be labbeled as well to return a value from a specified block if nested.

block_values