Control flow

Braces are always required. if is an expression. loop can return a value. Loops can be labeled for nested breaks.

if / elif / else

scratch.xs

while

scratch.xs

for

for iterates over arrays, ranges, strings (via .chars()), maps, and any generator.

scratch.xs
scratch.xs

loop

loop runs forever until an explicit break. It can return a value via break.

scratch.xs

break and continue

scratch.xs

Labeled loops

Labels let you break or continue an outer loop from inside a nested one.

scratch.xs