Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) Date: Tue, 14 Jul 2015 08:57:27 +0300 Organization: A noiseless patient Spider Lines: 16 Message-ID: <877fq3nuwo.fsf@elektro.pacujo.net> References: <55A3A853.4040006@rece.vub.ac.be> <55A3C366.6060602@rece.vub.ac.be> <87fv4r1fre.fsf@jester.gateway.sonic.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="32760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+B2RSS1JetsFVs9dzt6Pnc" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:9LqghhqDowklAqR/heUoz8fRh+g= sha1:t4n2Uqir27z//6vLL8B7nY2f19k= Xref: csiph.com comp.lang.python:93787 Ian Kelly : > On Mon, Jul 13, 2015 at 11:25 PM, Chris Angelico wrote: >> (Also, side point: Python can't actually optimize the above function, >> because it actually means "call quicksort, then discard its return >> value and return None". A true tail call has to return the result of >> the recursive call, and Python lacks a way to say "this function will >> always return None". But that's trivial.) > > Another point in favor of an explicit tail-call keyword. Then one > couldn't make that mistake. How about "return"? Marko