Tail recursion to while iteration in 2 easy steps

Alain Ketterlin alain at dpt-info.u-strasbg.fr
Tue Oct 8 04:56:20 EDT 2013


Antoon Pardon <antoon.pardon at rece.vub.ac.be> writes:

> Op 07-10-13 19:15, Alain Ketterlin schreef:

[...]
>> That's fine. My point was: you can't at the same time have full
>> dynamicity *and* procedural optimizations (like tail call opt).
>> Everybody should be clear about the trade-off.
>
> Your wrong. Full dynamics is not in contradiction with tail call
> optimisation. Scheme has already done it for years. You can rebind
> names to other functions in scheme and scheme still has working
> tail call optimisatiosn.

See
http://en.wikipedia.org/wiki/Scheme_%28programming_language%29#Lexical_scope

(first sentence, about variable bindings).

-- Alain.



More information about the Python-list mailing list