feat: forward named arguments in do iifes - #29
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements RFC 0097 by extending QuickCoffee’s do IIFE semantics to forward same-named outer values into immediately-invoked function literals that have only plain required name parameters, while rejecting defaults/rest/destructuring in that forwarding form. It updates compiler/parser enforcement, adds coverage for the new behavior, and refreshes RFC + manual/docs references accordingly.
Changes:
- Add
doargument forwarding for function literals with plain required name parameters (compiler emitsLoad+Call(n)instead of alwaysCall(0)). - Reject default/rest/destructuring parameters for forwarded
doIIFEs at parse time (and verify time as a backstop). - Add RFC/documentation updates and initial tests for forwarding + zero-arg compatibility.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/rfc_core.rs | Adds a new RFC-core test for do forwarding + compatibility cases. |
| src/parser.rs | Validates do + function-literal parameter shapes (rejects defaults/rest/destructuring for forwarding form). |
| src/bytecode.rs | Emits forwarded-argument loads and calls with correct arity for do + eligible function literals. |
| RFCs/0097-do-forwarded-arguments.md | New RFC describing the forwarding contract and constraints. |
| RFCs/0001-language-core.md | Updates core RFC index to reference RFC 0097. |
| README.md | Updates supported RFC range to include RFC 0097. |
| manuals/manual.zh-CN.qc | Adds do forwarding synopsis to the executable manual source (zh-CN). |
| manuals/manual.latin.qc | Adds do forwarding synopsis to the executable manual source (Latin). |
| manuals/manual.en.qc | Adds do forwarding synopsis to the executable manual source (English). |
| manuals/manual.devanagari-sa.qc | Adds do forwarding synopsis to the executable manual source (Devanagari Sanskrit). |
| manuals/manual.classical-zh.qc | Adds do forwarding synopsis to the executable manual source (Classical Chinese). |
| docs/syntax.zh-CN.md | Documents do forwarding and parameter restrictions (zh-CN). |
| docs/syntax.en.md | Documents do forwarding and parameter restrictions (en). |
| docs/manual.zh-CN.html | Regenerated manual HTML reflecting the new do synopsis (zh-CN). |
| docs/manual.latin.html | Regenerated manual HTML reflecting the new do synopsis (Latin). |
| docs/manual.en.html | Regenerated manual HTML reflecting the new do synopsis (English). |
| docs/manual.devanagari-sa.html | Regenerated manual HTML reflecting the new do synopsis (Devanagari Sanskrit). |
| docs/manual.classical-zh.html | Regenerated manual HTML reflecting the new do synopsis (Classical Chinese). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Base automatically changed from
perf/stepped-string-benchmark
to
feat/value-kind-api
August 22, 2026 18:00
tiye
force-pushed
the
feat/do-forward-args
branch
2 times, most recently
from
August 22, 2026 18:39
af0428e to
77cbf08
Compare
tiye
force-pushed
the
feat/value-kind-api
branch
from
August 22, 2026 18:40
398bf8d to
9a35143
Compare
tiye
force-pushed
the
feat/do-forward-args
branch
from
August 22, 2026 18:45
77cbf08 to
af590e0
Compare
tiye
force-pushed
the
docs/public-api-docs
branch
from
August 23, 2026 04:22
3fa5a8b to
3b05bf9
Compare
Base automatically changed from
docs/public-api-docs
to
feat/program-fingerprint
August 23, 2026 04:23
tiye
force-pushed
the
feat/do-forward-args
branch
from
August 23, 2026 04:26
af590e0 to
eb1a294
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
doargument forwardingdoIIFEsValidation
make checkdo_iifes_forward_same_named_outer_argumentstestmake docsand generated manual checks