Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!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 11:33:56 +0300 Organization: A noiseless patient Spider Lines: 29 Message-ID: <87pp3vm93f.fsf@elektro.pacujo.net> 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 Injection-Info: mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="27935"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6phIAv3q3qnuHvfnug+XQ" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:NGmFmu+RmQcMW0/U+o+XUu2ngzQ= sha1:Ms1xByG5yKbCut3AahP6NakOpwY= Xref: csiph.com comp.lang.python:93797 Ian Kelly : > On Mon, Jul 13, 2015 at 11:57 PM, Marko Rauhamaa wrote: >> How about "return"? > > I think you miss my point entirely. "return" doesn't mean tail-call > optimize; Why not? > it just means to return the result. Same difference. > This is what led to the confusion responsible for the bug that Chris > pointed out in the first place. With a keyword that explicitly means > "perform tail-call optimization *and* return", That could well be the explicit definition of the "return" statement in Python without changing the behavior of any working Python program today. > the association of the keyword with the optimization is much clearer, > and the programmer is much less likely to mistakenly omit it. The programmer shouldn't be controlling tail call optimizations. Marko