Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) Date: Tue, 14 Jul 2015 18:29:12 +1200 Lines: 26 Message-ID: References: <55A3A853.4040006@rece.vub.ac.be> <55A3C366.6060602@rece.vub.ac.be> <87fv4r1fre.fsf@jester.gateway.sonic.net> <877fq3nuwo.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net YpT9tPsrJTLkCd8xj1gtFQqbcac+Tr1t0dyF+d4Y8GXPEmsKY0 Cancel-Lock: sha1:F5Al43ejlLFcdZKf1qoC7eecLvw= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <877fq3nuwo.fsf@elektro.pacujo.net> Xref: csiph.com comp.lang.python:93789 Marko Rauhamaa wrote: > Ian Kelly : > >>Another point in favor of an explicit tail-call keyword. Then one >>couldn't make that mistake. > > How about "return"? How about "goto"? :-) That's not entirely an unserious suggestion -- if you really believe that a "goto with arguments" is a good feature for a language to have, you shouldn't be afraid to spell it as such. def quicksort(array, start, end): midp = partition(array, start, end) if midp <= (start+end)//2: quicksort(array, start, midp) goto quicksort(array, midp+1, end) else: quicksort(array, midp+1, end) goto quicksort(array, start, midp) -- Greg