Closures#14
Merged
Merged
Conversation
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]>
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.
No description provided.