Skip to content

Commit 458933b

Browse files
committed
fix: io+math STAGE-A resolution (ADR-011 use + trunc builtin seed)
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
1 parent 651cc12 commit 458933b

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/resolve.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ let create_context () : context =
6464
(* Numeric coercions and math *)
6565
def "int"; def "float";
6666
def "sqrt"; def "cbrt"; def "pow_float"; def "floor"; def "ceil"; def "round";
67+
def "trunc";
6768
def "abs"; def "max"; def "min";
6869
def "sin"; def "cos"; def "tan"; def "atan"; def "atan2";
6970
def "exp"; def "log"; def "log10"; def "log2";

stdlib/io.affine

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
// show(value) -> String
2121
// time_now() -> Float (CPU time in seconds)
2222

23+
// Cross-module imports (ADR-011: explicit `use module::{...}`)
24+
use string::{ split };
25+
2326
// ============================================================================
2427
// Console Output
2528
// ============================================================================

stdlib/string.affine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn repeat(s: String, n: Int) -> String {
116116
}
117117

118118
/// Split string by a delimiter
119-
fn split(s: String, delimiter: String) -> [String] {
119+
pub fn split(s: String, delimiter: String) -> [String] {
120120
let slen = len(s);
121121
let dlen = len(delimiter);
122122

0 commit comments

Comments
 (0)