A new module for performing tail-call elimination

Paul Rubin no.email at nospam.invalid
Sat Jul 18 05:06:57 CEST 2015


Chris Angelico <rosuav at gmail.com> writes:
> My point was that I have yet to see anything that demands TCO and
> can't be algorithmically improved.

I don't think anyone claimed you can't simulate TCO with updateable
variables and a while loop.  TCO just sometimes lets you write some
things in a cleaner (in proponnets' view) style.

> The best so far has been a quicksort that uses TCO to guarantee a
> maximum on stack usage.

I actually thought the state machine example was more convincing.  Doing
that without TCO would have required some kind of explicit control loop
and a messy dispatch mechanism instead of direct chaining from one state
to the next.


More information about the Python-list mailing list