Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
OCaml and tail recursion
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Norman Ramsey <nr@e...>
Subject: OCaml and tail recursion
Dear Camllists,

I have just completed my first nontrival Caml program (an implementation
of the rsync algorithm) and I am distressed about the treatment of
tail calls.  My code has to go through files one character at a time,
and as an SML programmer from way back, I wrote the code using three
mutually recursive functions that make tail calls to each other.
Imagine my surprise when I started getting errors with stack overflow!
Apparently ocamlc doesn't optimize tail calls.  I made some progress
by using ocamlopt, but I miss being able to use the debugger.
Do experienced Camllists have any suggestions?