ocaml: phase 6 String extensions (+6 tests, 406 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s

ends_with, contains, trim, split_on_char, replace_all, index_of —
wrap host SX primitives via new _string_* builtins. String module
now substantively covers OCaml's Stdlib.String.
This commit is contained in:
2026-05-08 15:34:18 +00:00
parent 9f05e24c52
commit f40dfbbeb5
4 changed files with 43 additions and 3 deletions

View File

@@ -58,6 +58,15 @@
(list "_string_upper" (fn (s) (upper s)))
(list "_string_lower" (fn (s) (lower s)))
(list "_string_starts_with" (fn (p) (fn (s) (starts-with? s p))))
(list "_string_ends_with" (fn (p) (fn (s) (ends-with? s p))))
(list "_string_contains" (fn (s) (fn (sub) (contains? s sub))))
(list "_string_trim" (fn (s) (trim s)))
(list "_string_split_on_char"
(fn (sep) (fn (s) (split s sep))))
(list "_string_replace"
(fn (s) (fn (a) (fn (b) (replace s a b)))))
(list "_string_index_of"
(fn (s) (fn (sub) (index-of s sub))))
(list "_int_of_string" (fn (s) (parse-number s)))
(list "_string_of_int" (fn (i) (str i)))
(list "_string_of_float" (fn (f) (str f)))