Skip to content

Closures#14

Merged
mdbergmann merged 7 commits into
masterfrom
closures
Jan 27, 2026
Merged

Closures#14
mdbergmann merged 7 commits into
masterfrom
closures

Conversation

@mdbergmann
Copy link
Copy Markdown
Owner

No description provided.

mdbergmann and others added 7 commits January 26, 2026 16:15
Add ASSERT and 68020 codegen entries, update date to match tag.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add the INVOKE keyword to enable calling SUBs and functions through
LONGINT variable pointers, supporting both statement and expression
contexts. When a variable is assigned via @subname, the compiler links
the variable to the SUB's symbol table entry, enabling type-safe
parameter passing using the SUB calling convention. A fallback MC/C
calling convention handles unlinked function pointers.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add BIND(@subname, arg1, arg2, ...) which creates a closure record
binding the first N arguments to a SUB. INVOKE dispatches through the
closure at compile time (dims > 0), mixing bound args from the heap
record with free args from the call site using load_params-style
frame setup. All 6 closure tests pass (3 Phase 1 + 3 Phase 2).

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Document function pointers and closures in the user guide and reference.
Adds BIND and INVOKE entries to ref.txt, a new "Function Pointers and
Closures" section to ace.txt with examples for callbacks, partial
application, and value-capture semantics, and regenerates the .guide files.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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