ocaml: phase 5.1 frequency.ml baseline + Format module alias (+2 tests, 498 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 27s

frequency.ml exercises the recently-added Hashtbl.iter / fold +
Hashtbl.find_opt + s.[i] indexing + for-loop together: build a
char-count table for 'abracadabra' then take the max via
Hashtbl.fold. Expected = 5 (a x 5). Total 25 baseline programs.

Format module added as a thin alias of Printf — sprintf, printf, and
asprintf all delegate to Printf.sprintf. The dynamic runtime doesn't
distinguish boxes/breaks, so format strings work the same as in
Printf and most Format-using OCaml programs now compile.
This commit is contained in:
2026-05-09 01:11:53 +00:00
parent 9907c1c58c
commit 34d518d555
5 changed files with 44 additions and 0 deletions

View File

@@ -407,6 +407,12 @@ _Newest first._
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
'a tree`) with insert + in-order traversal. Tests parametric ADT,
recursive match, List.append, List.fold_left.
- 2026-05-09 Phase 5.1 — frequency.ml baseline + Format module alias
(+2 tests, 498 total). frequency.ml builds a Hashtbl of char→count
via `Hashtbl.find_opt` + `Hashtbl.replace` inside a `for` loop, then
uses `Hashtbl.fold` to find the maximum count. `count_chars
"abracadabra"` → max is 5 (a×5). Format module added as a thin
alias of Printf — sprintf / printf / asprintf all delegate.
- 2026-05-09 Phase 4 — `lazy EXPR` + `Lazy.force` (+2 tests, 496
total). Tokenizer already had `lazy` as a keyword. parse-prefix now
emits `(:lazy EXPR)`; eval creates a one-element cell with state