Where did my thinking take the wrong turn
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <[email protected]> |
Hello,
Sorry for asking so much but I still have problems with the easy task of
the 99 Ocaml problems.
I now have to revert a list.
I have this :
let reverse list =
let rec reverse2 list2 acc =
match list2 with
| [] -> acc
| x::xs -> reverse2 (x::acc) xs
in reverse2 list [] ;;
But now list is never gets smaller so this runs forever.
I could take out the let rec reverse2 list acc part but somehow I have
to make a place where rhe reversed string is stored.
Roelof