This one might be dumb but I just don’t see it. This is my code
let rec lister old fixed =
let paren = Str.regexp "(|)" in
match old with
[] -> []
| h::t -> if Str.string_match paren h 0
then iter t ((Str.split_delim paren h)@fixed)
else iter t (h::fixed)
;;
let stl string =
let r = Str.regexp " " in
let l = lister (Str.split r string) []
;;
the error is on the last ;; and I’m getting unexpected token “;;”. I tried to rework it a bit like
let stl string =
let l = lister (Str.split (Str.regexp " ") string) []
;;
but still nothing. I don’t think the lister function will have an affect but I’ve included it anyways. Thoughts?
You have a let-in expression which is incomplete:
Try this:
or you can do something equivalent:
Check the OCaml documentation for more information.