The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.functional
From: Matthias Blume <f...@my.address.elsewhere>
Date: Wed, 14 Dec 2005 09:17:39 -0600
Local: Wed, Dec 14 2005 10:17 am
Subject: Re: Tail calls and exceptions
torb...@app-3.diku.dk (Torben Ęgidius Mogensen) writes:
> When you CPS transform exceptions, you get non-tail calls in the The truth of this statement depends on the kind of CPS transform that > CPS-transformed program. You can CPS-transform once more to get rid > of these (or CPS transform with two continuations at the same time: > one for normal return and one for exceptions). you are using. It is fairly easy to build a CPS converter that performs those two steps in one pass, thus directly constructing a program without non-tail calls from a program with exceptions and handlers. >> What's the best approach here? Am I stubborn to resist letting go of This is *not* true! SML/NJ, for example, has a mode in which programs >> stack traces for ease in debugging? Can TCO, exceptions, and useful >> error reporting co-exist peacefully, and is there a language that >> demonstrates this? Or is exception-handling the wrong solution >> entirely, despite the conveniences it allows? > Stack traces and tail-call optimisation can't coexist (you can get are instrumented at compile-time so they give traces that include all tail-calls -- except those that have been found (dynamically) to form a loop. The asymptotic space complexity of the annotated program is the same as that of the orginial un-instrumented program (although there is a hidden constant factor that depends on the particular program). In the trace, non-tail calls are marked CALL, tail-calls are marked > But that isn't really different from imperative languages not doing Indeed. What's more, most implementations of imperative languages > back traces of loops. will not be able to give you a trace of your GOTOs even when those GOTOs do not form a loop. Matthias You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||