From 458933bd07fd8dd03c33b6c93411f48a275de803 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 18 May 2026 00:53:29 +0100 Subject: [PATCH] fix: io+math STAGE-A resolution (ADR-011 use + trunc builtin seed) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit io.affine: split() is cross-module (defined in string.affine). Per the ruled ADR-011 model (explicit `use module::{...}`), make `split` pub in string.affine and add `use string::{ split };` to io.affine. math.affine: `trunc` is a genuine runtime builtin (interp.ml:674, kernel_sublang.ml:128) but was missing from the resolver builtin-seed list (siblings floor/ceil/round are seeded). Add `def "trunc"`. (pow/to_float/fract are defined locally in math.affine — not builtins.) Base 651cc12 (post #166/#168/#169). Refs #128 --- lib/resolve.ml | 1 + stdlib/io.affine | 3 +++ stdlib/string.affine | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/resolve.ml b/lib/resolve.ml index 51c37abb..7344e5f1 100644 --- a/lib/resolve.ml +++ b/lib/resolve.ml @@ -64,6 +64,7 @@ let create_context () : context = (* Numeric coercions and math *) def "int"; def "float"; def "sqrt"; def "cbrt"; def "pow_float"; def "floor"; def "ceil"; def "round"; + def "trunc"; def "abs"; def "max"; def "min"; def "sin"; def "cos"; def "tan"; def "atan"; def "atan2"; def "exp"; def "log"; def "log10"; def "log2"; diff --git a/stdlib/io.affine b/stdlib/io.affine index 307feb60..b71ad3ae 100644 --- a/stdlib/io.affine +++ b/stdlib/io.affine @@ -20,6 +20,9 @@ // show(value) -> String // time_now() -> Float (CPU time in seconds) +// Cross-module imports (ADR-011: explicit `use module::{...}`) +use string::{ split }; + // ============================================================================ // Console Output // ============================================================================ diff --git a/stdlib/string.affine b/stdlib/string.affine index 06976be6..e3235625 100644 --- a/stdlib/string.affine +++ b/stdlib/string.affine @@ -116,7 +116,7 @@ fn repeat(s: String, n: Int) -> String { } /// Split string by a delimiter -fn split(s: String, delimiter: String) -> [String] { +pub fn split(s: String, delimiter: String) -> [String] { let slen = len(s); let dlen = len(delimiter);