functional programming

Steve Holden sholden at bellatlantic.net
Fri Feb 25 11:26:07 EST 2000


Denys Duchier wrote:
> 
> Steve Holden <sholden at bellatlantic.net> writes:
> 
> > [remarks on the practicality of tail call optimization which
> >  seemed to overlook the need to retain context for exception
> >  handling]
> 
> No such thing was overlooked.  Calls appearing within the lexical
> scope of a try are not tail calls; thus they are not subject to tail
> call optimization...

I was thinking more of the need for stack traceback when errors were
detected.  I agree that a call at the end of a try block is not a
tail call.  I am just concerned that tail call optimization would lose
important debugging context unless you substitute some mechanism which
retains the required information, which would defeat the point of the
optimization.  Uncaught exceptions are handled at main level, and
need full dynamic context.

Or have I missed something?

> 
> ... or you can implement exception handling using continuations :-)
> 
> oh hum...
> 
> --
> Dr. Denys Duchier                       Denys.Duchier at ps.uni-sb.de
> Forschungsbereich Programmiersysteme    (Programming Systems Lab)
> Universitaet des Saarlandes, Geb. 45    http://www.ps.uni-sb.de/~duchier
> Postfach 15 11 50                       Phone: +49 681 302 5618
> 66041 Saarbruecken, Germany             Fax:   +49 681 302 5615

regards
 Steve
--
"If computing ever stops being fun, I'll stop doing it"



More information about the Python-list mailing list