From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Norman Ramsey <nr@eecs.harvard.edu>, caml-list@inria.fr
Cc: nr@labrador.eecs.harvard.edu
Subject: Re: OCaml and tail recursion
Date: Tue, 14 Dec 1999 09:20:35 +0100 [thread overview]
Message-ID: <19991214092035.33700@pauillac.inria.fr> (raw)
In-Reply-To: <199912131727.MAA20344@labrador.eecs.harvard.edu>; from Norman Ramsey on Mon, Dec 13, 1999 at 12:27:37PM -0500
> 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!
I'd like to see the code, since ocamlc performs tail calls, of course.
(ocamlopt too, although on some platforms the tail-call optimization
doesn't apply to calls with many arguments, e.g. 8 or more. But
ocamlc has no such limitation.)
- Xavier Leroy
next prev parent reply other threads:[~1999-12-14 17:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-13 17:27 Norman Ramsey
1999-12-14 8:20 ` Xavier Leroy [this message]
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=19991214092035.33700@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=caml-list@inria.fr \
--cc=nr@eecs.harvard.edu \
--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