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

@@ -262,9 +262,9 @@ SX CEK evaluator (both JS and OCaml hosts)
- [~] `Hashtbl`: `create`, `add`, `find`, `find_opt`, `replace`, `mem`,
`length`. Backed by a one-element list cell holding a SX dict;
keys coerced to strings via `str` for polymorphic-key support.
- [~] `String`: `length`, `get`, `sub`, `concat`, `uppercase_ascii`,
`lowercase_ascii`, `starts_with`. _(Pending: split_on_char, trim,
contains, ends_with, index_opt, replace_all.)_
- [x] `String`: `length`, `get`, `sub`, `concat`, `uppercase_ascii`,
`lowercase_ascii`, `starts_with`, `ends_with`, `contains`, `trim`,
`split_on_char`, `replace_all`, `index_of`.
- [~] `Char`: `code`, `chr`, `lowercase_ascii`, `uppercase_ascii`.
_(Pending: escaped.)_
- [~] `Int`: `to_string`, `of_string`, `abs`, `max`, `min`.
@@ -377,6 +377,9 @@ the "mother tongue" closure: OCaml → SX → OCaml. This means:
_Newest first._
- 2026-05-08 Phase 6 — String extensions: ends_with/contains/trim/
split_on_char/replace_all/index_of (+6 tests, 406 total). Wraps host
primitives via `_string_*` builtins.
- 2026-05-08 Phase 6 — `List.take/drop/filter_map/flat_map/concat_map`
(+6 tests, 400 total). Common functional helpers, all written in
OCaml. **400-test milestone.**