Skip to content

feat: forward named arguments in do iifes - #29

Merged
tiye merged 2 commits into
feat/program-fingerprintfrom
feat/do-forward-args
Aug 23, 2026
Merged

feat: forward named arguments in do iifes#29
tiye merged 2 commits into
feat/program-fingerprintfrom
feat/do-forward-args

Conversation

@tiye

@tiye tiye commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

  • add RFC 0097 for CoffeeScript-style do argument forwarding
  • forward same-named outer values for plain required name parameters
  • reject defaults, rest, and destructuring in forwarded do IIFEs
  • document and test zero-argument compatibility plus loop closure usage

Validation

  • make check
  • targeted do_iifes_forward_same_named_outer_arguments test
  • make docs and generated manual checks
  • manual CLI smoke test for stepped loop closures

Copilot AI lite review requested due to automatic review settings August 22, 2026 14:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 do argument forwarding for function literals with plain required name parameters (compiler emits Load + Call(n) instead of always Call(0)).
  • Reject default/rest/destructuring parameters for forwarded do IIFEs 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.

Comment thread tests/rfc_core.rs
Comment thread src/bytecode.rs Outdated
Base automatically changed from perf/stepped-string-benchmark to feat/value-kind-api August 22, 2026 18:00
@tiye
tiye force-pushed the feat/do-forward-args branch 2 times, most recently from af0428e to 77cbf08 Compare August 22, 2026 18:39
@tiye
tiye force-pushed the feat/value-kind-api branch from 398bf8d to 9a35143 Compare August 22, 2026 18:40
@tiye
tiye force-pushed the feat/do-forward-args branch from 77cbf08 to af590e0 Compare August 22, 2026 18:45
Base automatically changed from feat/value-kind-api to docs/public-api-docs August 23, 2026 04:11
@tiye
tiye force-pushed the docs/public-api-docs branch from 3fa5a8b to 3b05bf9 Compare August 23, 2026 04:22
Base automatically changed from docs/public-api-docs to feat/program-fingerprint August 23, 2026 04:23
@tiye
tiye force-pushed the feat/do-forward-args branch from af590e0 to eb1a294 Compare August 23, 2026 04:26
@tiye
tiye merged commit 215d7d5 into feat/program-fingerprint Aug 23, 2026
2 checks passed
@tiye
tiye deleted the feat/do-forward-args branch August 23, 2026 04:27
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.

2 participants