Control Flow
Conditionals, every kind of loop, and functions.
Conditionals
if, elif, and else work exactly as you would expect, with braces for the blocks.
while loops
Loop while a condition holds. Combined with a counter and the increment operator, this is the classic countdown engine.
for loops
Three flavours: a classic counter, iterating a list or dict, and counting over a range.
break, continue, and stop
break and continue work inside loops. stop halts the whole tag immediately. Anything already sent with say is still delivered, and everything after is skipped.
A switch is also available for dispatching on a value when a chain of elifs starts to drag.
Functions
Named and anonymous. A function body always uses braces. Define once, call anywhere.
Functions are first-class, so you can hand them to the list builtins for a quick map, filter, or reduce.
The full set of list combinators lives in the Builtins chapter.