emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: named-let


From: Andrea Corallo
Subject: Re: named-let
Date: Tue, 12 Jan 2021 09:24:46 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> [ TCO has also undesirable interactions with debugging/tracing, but
>>>   I think that would be a secondary concern which should be
>>>   manageable somehow.  ]
>>
>> It's also a change in semantic as one must assume that `bar' is not
>> redefining `foo'.
>>
>> (defun foo ()
>>   (bar)
>>   (foo))
>
> I think there's a bit of confusion: you can have TCO without having to
> pay any attention to whether `bar` changes `foo`.  True TCO will also
> avoid eating up stack space when you have code like

Yes, I was discussing Tail Recursion Eliminination (or self TCO).

Actually I was thinking one could even check if `foo' was redefined
before performing the TRE sequence (well I guess that's what the
byteinterpreter patches you've mentioned did), in this case we could
have it also at speed 2.

As a side note I think we could have full TCO in Emacs, but at the cost
of a relatively invasive patch and a some (probably small but hard
to quantify a priori) performance regression.  Not sure it is
sufficiently important to justify that.

  Andrea



reply via email to

[Prev in Thread] Current Thread [Next in Thread]