Re-bootstrap compiler + render after IO registry and Step 5 changes

Compiler (lib/compiler.sx):
- Fix emit-op return type: 8 definition form cases (defstyle,
  defhandler, defpage, etc.) and the perform case now return nil
  explicitly via (do (emit-op em N) nil) instead of bare emit-op
  which transpiled to unit-returning OCaml.
- compile_match PREAMBLE: return Nil instead of unit (was ignore).
- Added init wrapper to PREAMBLE (needed by compile-module).
- All 41 compiler functions re-transpiled cleanly.

Render (bootstrap_render.py): re-transpiled, no changes.

Runtime: restored keyword_p predicate (needed by defio-parse-kwargs!
in the transpiled evaluator).

2608/2608 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 21:26:20 +00:00
parent 5f72801901
commit 397d0f39c0
3 changed files with 21 additions and 15 deletions

View File

@@ -60,6 +60,7 @@ let abs v = prim_call "abs" [v]
let min a b = prim_call "min" [a; b]
let max a b = prim_call "max" [a; b]
let set_nth_b lst idx v = prim_call "set-nth!" [lst; idx; v]
let init lst = prim_call "init" [lst]
(* skip_annotations: strips :keyword value pairs from a list (type annotations) *)
let rec skip_annotations items =
@@ -76,7 +77,8 @@ let rec skip_annotations items =
Falls back to CEK evaluation at runtime. *)
let compile_match em args scope tail_p =
let fn = Sx_ref.eval_expr (Symbol "compile-match") (Env (Sx_types.make_env ())) in
ignore (Sx_ref.cek_call fn (List [em; args; scope; tail_p]))
ignore (Sx_ref.cek_call fn (List [em; args; scope; tail_p]));
Nil
"""