spec: prose-loop-binders — loop binders out of the body block
Form-B prose renders loop binders as bare `name = init;` statements
inside the `loop { … }` body, which reads as C/Rust re-init-every-
iteration semantics — a lie about a body the projection exists to
let the reader trust. Redesign: parenthesised init-list on the
keyword, `loop(acc = 0, i = 1) { … }`, positionally isomorphic to
`recur(...)`. Projection-only; loop/recur AST, Form A, JSON-AST,
typecheck, codegen, and the Form-A↔JSON round-trip invariant are
untouched. Step-7.5 grounding-check PASS. Roadmap entry opened P0
in-flight.
This commit is contained in:
@@ -35,6 +35,20 @@ work progresses.
|
||||
|
||||
## P0 — In flight
|
||||
|
||||
- [~] **\[milestone\]** Prose `loop` binders — projection redesign.
|
||||
Form-B prose currently renders loop binders as `name = init;`
|
||||
statements *inside* the `loop { … }` body, which misreads as
|
||||
C/Rust re-init-every-iteration semantics. Move them to a
|
||||
parenthesised init-list on the keyword — `loop(acc = 0, i = 1)
|
||||
{ … }` — positionally isomorphic to `recur(...)`. Projection-only:
|
||||
one `ailang-prose` `write_term` `Term::Loop` arm + 2 snapshot
|
||||
fixtures/tests; loop/recur AST, Form A, JSON-AST, typecheck,
|
||||
codegen, and the Form-A↔JSON round-trip invariant all unchanged.
|
||||
Spec'd + approved 2026-05-18; Step-7.5 grounding-check PASS. Plan
|
||||
next.
|
||||
- context: `docs/specs/2026-05-18-prose-loop-binders.md`;
|
||||
surfaced from the loop/recur prose review (2026-05-18 chat).
|
||||
|
||||
- [x] **\[milestone\]** Standalone `loop` / `recur` — CLOSED 2026-05-18.
|
||||
Strictly-additive strict-iteration surface, `recur` tail-position-only,
|
||||
no totality claim. Shipped: iter 1 `a179ec3` (additive AST nodes),
|
||||
|
||||
Reference in New Issue
Block a user