ocaml: phase 2+6 print primitives wire to host display (+2 tests, 444 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s

print_string / print_endline / print_int / print_newline now route to
SX display primitive (not the non-existent print/println). print_endline
appends '\n'.

let _ = expr ;; at top level confirmed working via the
wildcard-param parser.
This commit is contained in:
2026-05-08 17:37:00 +00:00
parent cabf5dc9c3
commit 0bc6dbd233
3 changed files with 22 additions and 4 deletions

View File

@@ -1092,6 +1092,12 @@ cat > "$TMPFILE" << 'EPOCHS'
(epoch 3802)
(eval "(ocaml-type-of \"let f x = x + 1 and g x = x * 2 in f 1 + g 2\")")
;; ── let _ = expr top-level ─────────────────────────────────────
(epoch 3900)
(eval "(ocaml-run-program \"let _ = 1 + 2 ;; 42\")")
(epoch 3901)
(eval "(ocaml-run-program \"let x = 10 ;; let _ = x ;; x * 2\")")
EPOCHS
OUTPUT=$(timeout 180 "$SX_SERVER" < "$TMPFILE" 2>/dev/null)
@@ -1728,6 +1734,10 @@ check 3800 "let-mut x+y : Int" '"Int"'
check 3801 "let-rec-mut even" '"Int -> Bool"'
check 3802 "let-mut f and g" '"Int"'
# ── let _ = expr top-level ─────────────────────────────────────
check 3900 "let _ = 1+2;; 42" '42'
check 3901 "two top-level lets, _" '20'
TOTAL=$((PASS + FAIL))
if [ $FAIL -eq 0 ]; then
echo "ok $PASS/$TOTAL OCaml-on-SX tests passed"