The closure check was only in vm_call (sx_vm.ml) but inner functions like read-list-loop were also compiled through the JIT hook in sx_server.ml. The hook compiled them with closure merging, producing incorrect bytecode (read-list-loop mishandled closing parens). Added the same closure check to the JIT hook: skip lambdas with non-empty closures. Now sx-parse works correctly: (a (b) (c)) → 3 siblings, not (a (b (c))) Pre-compiled count increased from 17 to 33 — more top-level functions compiled (inner ones correctly skipped to CEK). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 KiB
35 KiB