functional programming

Moshe Zadka moshez at math.huji.ac.il
Fri Feb 25 15:38:35 EST 2000


On 25 Feb 2000, Denys Duchier wrote:

> The point, however, is moot since, as I suggested previously, the
> finalization semantics of Python (much like that of C++) are not
> easily reconciled with tail call optimization.

I won't say anything about C++ (what I'd like to say about it isn't
fit for prime time), but about Python, this is untrue: either the called
function has a reference to the object (in which case it won't be
finalized) or it can be deleted when the calling frame is deleted, in
which case the call to the destructor will *precede* the tail-call,
and still leave it in tail position.

The only argument worth a spit is Tim's "but what about them tracebacks",
and I said that it's quite all right if tail-call optimization only
happens when the switch -tail-call-optimize-i-don't-need-tracebacks
is given to the interpreter.

Oh, the other argument worth a spit is that it isn't implemented and no
one (including me) doesn't care enough to code it, and then to harass
Guido enough that he'll accept the patch.

non-tail-signature-ly y'rs, Z.
--
Moshe Zadka <mzadka at geocities.com>. 
INTERNET: Learn what you know.
Share what you don't.





More information about the Python-list mailing list