[Python-Dev] Proper tail recursion

Christopher T King squirrel at WPI.EDU
Thu Jul 15 16:55:23 CEST 2004


On Thu, 15 Jul 2004, Guido van Rossum wrote:

> > How about: Tail recursion "enables" recursion-oriented (functional)
> > style? :)
> 
> Still -1.  I was understating my case: I find the "recursion is the
> basis of everything" attitude harmful.

I think it's still best to "enable" such a style in some cases -- Python's 
syntax is designed to allow formulation of a problem in the most natural 
way.  Sometimes it's more natural to formulate a problem as a recursive 
function than a procedural one, but the current implementation restricts 
this.

I agree that "recursion is the basis of everything" is harmful, but I
think the same belief can apply to "procedularism is the basis of
everything" (why do we have classes, list comprehensions, etc.?).  Some 
things are better formulated in a procedural style, while others are 
better formulated in a recursive style.




More information about the Python-Dev mailing list