I think you mean ... in length2 list []

Den 5 nov 2014 19:47 skrev "Roelof Wobben" <r.wobben@home.nl>:
Hello,

I asked this question also on the beginners list but till now no respons.

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



--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs