Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: A new module for performing tail-call elimination Date: Fri, 17 Jul 2015 20:06:57 -0700 Organization: A noiseless patient Spider Lines: 15 Message-ID: <87pp3qyxim.fsf@jester.gateway.sonic.net> References: <55a3dcd9$0$3024$426a34cc@news.free.fr> <55a76628$0$2846$c3e8da3$76491128@news.astraweb.com> <55A78A42.4090506@rece.vub.ac.be> <55A7B309.8080903@rece.vub.ac.be> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="4fa08f1ce1db3b0ae8c51611453a050c"; logging-data="19753"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ddAX0Fx9upDpgvThbkpg1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:cuOGO+TMJueYcUz/gI3AmGJkLNg= sha1:v3t9QR6ezGMND11oYhLOL19BUPo= Xref: csiph.com comp.lang.python:94047 Chris Angelico 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.