Skip to content

Spec v7.3 (D69): generators are push-based - #1723

Merged
ehartford merged 1 commit into
mainfrom
gen-push-spec
Sep 26, 2026
Merged

ehartford merged 1 commit into
mainfrom
gen-push-spec

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Rewrites §13.4 per Eric's ruling (D69). Docs + example prose only; spec-inventory-check green. Draft until Eric blesses the exact words. The compiler is NON-COMPLIANT until generators lower as calls (implementation follows in its own PR).

…mer's loop body at each yield

§13.4 rewritten: a generator value holds its arguments and runs when
consumed through Gen[T].each; a consumer's stop leaves the generator at
its yield as if by return, releasing its scopes; a generator may yield
views of its own locals; `g.pull()` gives a fiber-backed Iter[T] where
code must step the sequence. §14.20's table, the §14 ephemeral-handle
cross-reference and the §13.1 zero-copy example follow. The state-machine
model, the no-references-across-yield rule and the .await prohibition are
retired. The nebula example's generator prose follows the spec (D55
ruling 4: a spec change updates its examples in the same change).

The compiler is NON-COMPLIANT until generators lower as calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant