From db1f7f1bfb16e660237eeb84e4a61e8057ae3e1e Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 3 Apr 2026 14:04:40 +0000 Subject: [PATCH] Retranspile sx_ref.ml with mutable globals from transpiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No more regex fixups for *strict* / *prim-param-types* — transpiler handles reads (!_ref), writes (_ref :=), and defines natively. 2566/2568 tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) --- hosts/ocaml/lib/sx_ref.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hosts/ocaml/lib/sx_ref.ml b/hosts/ocaml/lib/sx_ref.ml index a38d1c51..a889ea0d 100644 --- a/hosts/ocaml/lib/sx_ref.ml +++ b/hosts/ocaml/lib/sx_ref.ml @@ -296,18 +296,20 @@ and render_fn = Nil (* *strict* *) -and _strict_ = !_strict_ref +and _strict_ = + !_strict_ref (* set-strict! *) and set_strict_b val' = - _strict_ref := val'; Nil + let _strict_ = ref Nil in (_strict_ref := val'; Nil) (* *prim-param-types* *) -and _prim_param_types_ = !_prim_param_types_ref +and _prim_param_types_ = + !_prim_param_types_ref (* set-prim-param-types! *) and set_prim_param_types_b types = - _prim_param_types_ref := types; Nil + let _prim_param_types_ = ref Nil in (_prim_param_types_ref := types; Nil) (* value-matches-type? *) and value_matches_type_p val' expected_type =