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!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: A new module for performing tail-call elimination Date: Sun, 19 Jul 2015 10:39:29 +1200 Lines: 22 Message-ID: References: <55a3dcd9$0$3024$426a34cc@news.free.fr> <55A6280C.3090602@rece.vub.ac.be> <55A76116.7070708@rece.vub.ac.be> <87lhefanui.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 18BwZfCDQU4EYjnAad4ZXwyeGA8W7W7cXuL/Qg+gpu67bu48fh Cancel-Lock: sha1:qi7bhkUN8GEee51YkVP3nIEAFJA= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <87lhefanui.fsf@elektro.pacujo.net> Xref: csiph.com comp.lang.python:94064 Marko Rauhamaa wrote: > At any rate, it demonstrates how the idiom has its place in Python. Perhaps it does, but I think I'd still prefer it to be explicit. The call in Marko's example is not actually a tail call as written. To make it a tail call, a return would need to be added: > return child.setvalue(keyseq, value, offset + 1) To someone reading the code, it's not obvious why the return is there. It looks redundant, and is likely to get removed by someone who thinks it's a mistake. Using a dedicated keyword would make it clear that tail call behaviour is being relied upon, and avoid looking like a spurious return. -- Greg