Skip to content

Iteration and conditional binding

X forwards iteration to P's Iterate primitive. Each supported form has one Operation body. Inputs select mutually exclusive categories:

Table: scroll horizontally to read all columns.

CategoryInputsRust shape
TraversalIterable, existing Key/Index/RangeArity metadata, no condition childfor pattern in iterable { body }
Unconditional repetitionNo Iterable or condition childloop { body }
Boolean repetitionOne Calculation or an I/Evaluation adapter holding ordered Calculationswhile condition { body }
Definitional repetitionOne OG or DOG Definitionwhile let pattern = value { body }

The caller owns iterator expressions, patterns, borrowing and explicit native await. The generator inserts no iterator adapter, enumeration or channel-drain loop. I remains a Boolean condition adapter, not an initialization/step/body carrier.

OG takes one Key/Keys native pattern and one nonempty Value/Values, without children. DOG takes the pattern and exactly one Calculation, without native Values. They only occur as X conditions and preserve let pattern = value as a fragment. PO attaches one native label to one Iteration, with no extra wrapper block, native Values or trailing semicolon.

This allows the label to target the loop itself. Condition bindings have their Rust loop-body scope; they do not become surrounding L paragraph bindings. Native pattern syntax is supplied data, not a general pattern language invented at the AML boundary.

Three-part initialization/condition/step loops are unsupported and rejected before rendering. Multiple bodies, mixed iterator/condition inputs, wrong child roles, misplaced OG/DOG and invalid label compositions also reject.

Conditions, bindings, traversal, labels, nested scope and explicit async are bounded complete-AML witnesses. Native negative controls require E0308 for a nonboolean condition, E0425 for a binding used outside its scope and E0728 for await in synchronous context.

The corpus has fifty stored malformed iteration inputs. Generation and compilation do not run these loops or establish termination. Read Iteration, Iterate, iteration tests, and the maintained iteration contract.