floor(0)=-1 bug fixed + 12/12 adapter compiles + primitives

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 22:34:51 +00:00
parent 231bfbecb5
commit e6663a74ba
2 changed files with 16 additions and 3 deletions

View File

@@ -246,7 +246,12 @@ let rec run vm =
let args = List.init argc (fun _ -> pop vm) |> List.rev in
let result =
try
(match Sx_primitives.get_primitive name with
(* Check globals first (has env bindings like set-render-active!),
then fall back to registered primitives *)
let fn_val = try Hashtbl.find vm.globals name with Not_found ->
Sx_primitives.get_primitive name
in
(match fn_val with
| NativeFn (_, fn) -> fn args
| _ -> Nil)
with Eval_error msg ->