Skip to content

Control Flow

Accepted

Accepted for V1 control-flow source forms, including loop source selection and cleanup behavior. Reassignable loop bindings are deferred.

Catalyst uses expression-oriented control flow where it improves clarity, while keeping statement separation explicit through newlines.

This folder records source forms and lowering boundaries for control-flow constructs.

Topics

  • Blocks and Statements: block values, void, statement separation, divergence, and semicolons.
  • Conditionals: if ... else ... as statements and expressions.
  • Optional Bindings: optional presence tests, payload binding, same-name sugar, and optional binding ownership.
  • Loops: while, while const, for, loop result type, and basic lowering.
  • Iterator Loop Sources: iterator source selection, hidden iterator cleanup, dynamic iteration, and resource behavior.
  • Defer: scope-exit cleanup, ordering, early-exit behavior, and resource-lint interaction.