functional programming

Moshe Zadka moshez at math.huji.ac.il
Thu Feb 24 03:50:09 EST 2000


On Thu, 24 Feb 2000, Tim Peters wrote:

[Moshe Zadka,o Aahz]
> Assuming we're still in "search of truth" mode, rather then "proving
> I'm right" mode, I want to clarify my claim: *efficienct* functional
> programming is, in general, impossible without tail-recursion. I don't
> agree with the timbot that tail-recursion is contrary to the "Python
> Way", but it's not in Python right now, anyway.
>
> Are we in agreement now?

[The timbot, butting in <wink>]
> You and Aahz maybe, but now we've got a fight <wink>.  There's nothing
> un-Pythonic about recursion, tail or otherwise.  It's tail-call
> *optimization* that's un-Pythonic, as it's a gimmick supported by only a
> handful of widely unused <0.5 wink> languages and surprising to people
> coming from anything else:  damaging tracebacks would be Major Badness, much
> worse than the gain for the relative thimbleful of people who are
> uncomfortable coding loops etc.

The idiom "return f(something)" is used almost exclusively by this anal
retentive bunch I'm proud to be part of <wink>. And I don't mind at all
having Python do no optimization as long as I do not give the flag
-believe-me-I-really-do-want-tail-call-optimization <0.5 wink>

As this flag has very little semantic effect (after all, it is an
optimization), I don't think there should be any problems with it, except
two:

1. I don't care *enough* to write the patch
2. Guido probably won't like it

disagreeing-with-Guido-and-the-timbot-is-scary-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