VM upvalues + HO primitives + 40 tests (36 pass, 4 fail)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 20:41:23 +00:00
parent 1bb40415a8
commit e7da397f8e
5 changed files with 432 additions and 8 deletions

View File

@@ -23,14 +23,12 @@ let _prim_param_types_ref = ref Nil
(* === Transpiled from evaluator (frames + eval + CEK) === *)
(* make-cek-state *)
let _cek_steps = ref 0
let rec make_cek_state control env kont =
(incr _cek_steps; CekState { cs_control = control; cs_env = env; cs_kont = kont; cs_phase = "eval"; cs_value = Nil })
(CekState { cs_control = control; cs_env = env; cs_kont = kont; cs_phase = "eval"; cs_value = Nil })
(* make-cek-value *)
and make_cek_value value env kont =
(incr _cek_steps; CekState { cs_control = Nil; cs_env = env; cs_kont = kont; cs_phase = "continue"; cs_value = value })
(CekState { cs_control = Nil; cs_env = env; cs_kont = kont; cs_phase = "continue"; cs_value = value })
(* cek-terminal? *)
and cek_terminal_p state =