Step 10c: bind CEK special form + provide-set frame + scope-stack integration
bind is now a CEK special form that captures its body unevaluated, establishes a tracking context (*bind-tracking*), and registers subscribers on provide frames when context reads are tracked. - bind special form: step-sf-bind, make-bind-frame, bind continue handler - provide-set frame: provide! evaluates value with kont (fixes peek bug) - context tracking: step-sf-context appends to *bind-tracking* when active - scope-stack fallback: provide pushes to scope stack for cek-call contexts - CekFrame mutation: cf_remaining/cf_results/cf_extra2 now mutable - Transpiler: subscribers + prev-tracking field mappings, *bind-tracking* in ml-mutable-globals - Test fixes: string-append → str, restored edge-cases suite Passing: bind returns initial value, bind with expression, bind with let, bind no deps is static, bind with conditional deps, provide! updates/multiple/nil, provide! computed new value, peek read-modify-write, guard inside bind, bind with string-append, provide! same value does not notify, bind does not fire on unrelated provide!, bind sees latest value, bind inside provide scope. Remaining: subscriber re-evaluation on provide! (scope-stack key issue), batch coalescing (no batch support yet). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -285,7 +285,7 @@
|
||||
|
||||
(define
|
||||
ml-mutable-globals
|
||||
(list "*strict*" "*prim-param-types*" "*last-error-kont*"))
|
||||
(list "*strict*" "*prim-param-types*" "*last-error-kont*" "*bind-tracking*"))
|
||||
|
||||
(define
|
||||
ml-is-mutable-global?
|
||||
@@ -539,6 +539,8 @@
|
||||
(ef "results")
|
||||
(some (fn (k) (= k "raw-args")) items)
|
||||
(ef "raw-args")
|
||||
(some (fn (k) (= k "subscribers")) items)
|
||||
(ef "subscribers")
|
||||
:else "Nil")
|
||||
"; cf_extra = "
|
||||
(cond
|
||||
@@ -562,6 +564,8 @@
|
||||
(ef "update-fn")
|
||||
(some (fn (k) (= k "head-name")) items)
|
||||
(ef "head-name")
|
||||
(some (fn (k) (= k "prev-tracking")) items)
|
||||
(ef "prev-tracking")
|
||||
(some (fn (k) (= k "extra")) items)
|
||||
(ef "extra")
|
||||
:else "Nil")
|
||||
|
||||
Reference in New Issue
Block a user