functional programming

bjorn bjorn at
Tue Feb 22 12:58:28 EST 2000

Moshe Zadka wrote:

> On 22 Feb 2000, [ISO-8859-1] François Pinard wrote:
> > What would be the advantages of using a "functional" Python, as per your
> > definition?I mean, of course, in practice?
> None. But it would be cool to have tail recursion, which could probably
> be implemented in a post-Stackless world.

Maybe I'm dense, but what is stopping us from implementing tail call
optimization (of which tail recursion is just a special case) with the current
Python implementation.  Identifying a call in a tail position is a simple
static analysis that isn't affected by Python's dynamicity (is that a word?).
Once they're identified you only need to translate a call to a jump instead of
a push return address and jump.  There is no semantic change to Python.

maybe-if-I-knew-Python-internals-I-would-know-better'ly y'rs
-- bjorn

More information about the Python-list mailing list