Fix named-let set! scoping + convert test to deftest

Named let's sf-named-let used call-lambda which returns a thunk that
was never trampolined. The body executed in a disconnected env, so
set! couldn't reach outer let bindings. Fixed by using cek-call which
evaluates through the full CEK machine with proper env chain.

Also converted test-named-let-set.sx from assert= (uses broken = for
lists) to deftest/assert-equal (uses deep equal?).

JS standard: 1120/1120, JS full: 1600/1600. Zero failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 21:34:19 +00:00
parent fde376a7dd
commit 83b4afcd7a
3 changed files with 37 additions and 51 deletions

View File

@@ -544,7 +544,7 @@
(env-bind! (lambda-closure loop-fn) loop-name loop-fn)
(let
((init-vals (map (fn (e) (trampoline (eval-expr e env))) inits)))
(call-lambda loop-fn init-vals env))))))
(cek-call loop-fn init-vals))))))
(define
sf-lambda