[Python-ideas] A Continuations Compromise in Python

Greg Ewing greg.ewing at canterbury.ac.nz
Mon May 4 02:22:11 CEST 2009


Stephen J. Turnbull wrote:

> I thought that was a good part of the appeal of TCO, though, that the
> compiler can often arrange to do data manipulations in such a way that
> the stack frame (or even data-in-register) is just there, ready to go
> when control is transferred.

Possibly that could be done in the case of self-recursion,
but it would be trickier when the function being tail-called
is a different one.

In that case you also have the problem that the called
function can have a different stack size, number of local
variables, list of constants, etc. You can't just re-use
the same stack frame for a different function without
making various adjustments.

-- 
Greg



More information about the Python-ideas mailing list