Possibly Pythonic Tail Call Optimization (TCO/TRE)
antoon.pardon at rece.vub.ac.be
Wed Jul 15 13:04:32 CEST 2015
On 07/15/2015 12:55 PM, Marko Rauhamaa wrote:
> Ned Batchelder <ned at nedbatchelder.com>:
>> On Wednesday, July 15, 2015 at 2:44:55 AM UTC-4, Marko Rauhamaa wrote:
>>> The other problem for tail call elimination is the requirement that
>>> functions return None by default. Smooth tail call elimination would
>>> require that Python leave the default return value unspecified.
>> I don't understand this, can you explain more? Are you saying that the
>> Python specification shouldn't specify what x becomes?:
>> def who_knows():
>> x = who_knows()
> Yes, that's what I'm saying. The implementation would be free to assign
> any value whatsoever to x.
And can you explain why this would be needed foor smooth tail call elimination?
More information about the Python-list