From: Norman Ramsey <nr@eecs.harvard.edu>
To: caml-list@inria.fr
Cc: nr@labrador.eecs.harvard.edu
Subject: OCaml and tail recursion
Date: Mon, 13 Dec 1999 12:27:37 -0500 [thread overview]
Message-ID: <199912131727.MAA20344@labrador.eecs.harvard.edu> (raw)
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?
Norman
next reply other threads:[~1999-12-14 7:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-13 17:27 Norman Ramsey [this message]
1999-12-14 8:20 ` Xavier Leroy
1999-12-14 15:32 ` Alain Frisch
1999-12-14 21:20 ` Jerome Vouillon
1999-12-15 14:10 ` Jean-Francois Monin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199912131727.MAA20344@labrador.eecs.harvard.edu \
--to=nr@eecs.harvard.edu \
--cc=caml-list@inria.fr \
--cc=nr@labrador.eecs.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox