Statements¶
Statements control execution and side effects within blocks.
Quick patterns¶
- Use
LETfor new bindings andSETfor mutation. - Guard code with
IFandTRY/CATCH. FOR EACHiterates collections; comprehensions provide shorthand for arrays.OUTPUT { ... }shapes final payloads.
Output¶
OUTPUT specifies how results are emitted from the pipeline.
Using¶
USING references adapters and external modules.
Transform¶
TRANSFORM defines transformation steps. Use OPTIONS { ... } after the signature to declare per-transform settings.
For loops¶
FOR and FOR EACH iterate over collections.
If statements¶
IF provides conditional branching.
Enumerations¶
ENUM defines enumerated types inside TYPE declarations.
For each shorthand¶
FOREACH is a shorthand loop form.
Input¶
INPUT references the pipeline input data.
Abort¶
ABORT terminates execution immediately.
Throw¶
THROW raises an error.
Try/Catch¶
TRY handles errors and exceptions.
Call¶
CALL invokes host-provided functions.
Shared¶
SHARED declares shared memory resources.
Functions¶
FUNC declares reusable functions.
Types¶
TYPE declares custom types.
Return¶
RETURN exits from functions.
Modify¶
MODIFY changes existing values.
Where¶
WHERE filters loop iterations and comprehensions.
Set And Plus Assign¶
SET replaces an existing variable or path value. += updates an explicit local accumulator: it appends one item when the current value is a list, adds numeric values when both sides are numeric, and follows + string concatenation when either side is text.
+= does not create missing variables or intermediate containers. Initialize accumulators with LET before updating them.
| Intent | Preferred statement style |
|---|---|
| Replace a local variable | SET name = value |
| Replace an existing path | SET object.path = value |
| Append to an accumulator list | items += item |
| Append to a nested accumulator list | state.items += item |
| Build a new list expression | LET next = APPEND(items, item) |
SET x = APPEND(x, value) is tolerated when written manually, but it is not the preferred accumulator style. Use x += value for explicit accumulation and keep APPEND(list, value) for expression contexts.