Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 33s
lib/ocaml/baseline/{factorial,list_ops,option_match,module_use,sum_squares}.ml
exercised through ocaml-run-program (file-read F). lib/ocaml/baseline/
run.sh runs them and compares against expected.json — all 5 pass.
To make module_use.ml (with nested let-in) parse, parser's
skip-let-rhs-boundary! now uses has-matching-in? lookahead: a let at
depth 0 in a let-decl rhs opens a nested block IFF a matching in
exists before any decl-keyword. Without that in, the let is a new
top-level decl (preserves test 274 'let x = 1 let y = 2').
This is the first piece of Phase 5.1 'vendor a slice of OCaml
testsuite' — handcrafted fixtures for now, real testsuite TBD.
6 lines
179 B
OCaml
6 lines
179 B
OCaml
(* Baseline: List functions exercise *)
|
|
let xs = [1; 2; 3; 4; 5] ;;
|
|
let doubled = List.map (fun x -> x * 2) xs ;;
|
|
let total = List.fold_left (fun a b -> a + b) 0 doubled ;;
|
|
total
|