Replace continuation-based scope frames with hashtable stacks for all scope operations. The CEK evaluator's scope/provide/context/emit!/emitted now use scope-push!/pop!/peek/emit! primitives (registered in sx_primitives table) instead of walking continuation frames. This eliminates the two-world problem where the aser used hashtable stacks (scope-push!/pop!) but eval-expr used continuation frames (ScopeFrame/ScopeAccFrame). Now both paths share the same mechanism. Benefits: - scope/context works inside eval-expr calls (e.g. (str ... (context x))) - O(1) scope lookup vs O(n) continuation walking - Simpler — no ScopeFrame/ScopeAccFrame/ProvideFrame creation/dispatch - VM-compiled code and CEK code both see the same scope state Also registers scope-push!/pop!/peek/emit!/collect!/collected/ clear-collected! as real primitives (sx_primitives table) so the transpiled evaluator can call them directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
94 KiB
94 KiB