why is acc here unbound
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have this :
let length list =
let rec length2 list2 acc =
match list2 with
| [] -> acc
| x::xs -> length2 xs (acc + 1)
in acc 0 list2 list ;;
But as soon as I copie it into the ocaml prompt I see a message that the
acc in the part in acc 0 list2 list is unbound.
Roelof