Where did my thinking take the wrong turn

"Roelof Wobben [email protected] [ocaml_beginners]" <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.