[Python-ideas] A Continuations Compromise in Python

spir denis.spir at free.fr
Sun May 3 21:02:09 CEST 2009


Le Sun, 3 May 2009 18:42:20 +0100,
Arnaud Delobelle <arnodel at googlemail.com> s'exprima ainsi:

> This can be done with recursive tail calls, but I guess that in
> Python, in general, the compiler is not able to know whether a tail
> call is actually calling the function currently being executed, as the
> compiler only knows it calls a function with a given name (which is
> only bound to an object at runtime).  However, I think that the
> interpreter would be able to decide this at run time - and even to
> short-circuit the packing/unpacking sequence of parameters.

The explicit keyword solution proposed is a big help, in this case. Then the interpreter can (try and) proceed to optimization as required -- and possibly fail and protest against wrong requirement. Instead of collecting all needed information and running complicated algorithms _just to know_ whether optimization is simply possible -- before any process.

Denis
------
la vita e estrany



More information about the Python-ideas mailing list