functional programming

Toby Dickenson mbel44 at dial.pipex.net
Fri Feb 25 04:49:54 EST 2000


Moshe Zadka <moshez at math.huji.ac.il> wrote:

>[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

It looks like it should be possible to implement a tail-optimised
variant of apply() using Stackless?

(is that a statement or a question? Im not sure either)




Toby Dickenson
tdickenson at geminidataloggers.com



More information about the Python-list mailing list