[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
- Re: named-let, (continued)
- Re: named-let, Zhu Zihao, 2021/01/10
- Re: named-let, Tomas Hlavaty, 2021/01/11
- Re: named-let, Stefan Monnier, 2021/01/11
- Re: named-let, Tomas Hlavaty, 2021/01/11
- Re: named-let, Andrea Corallo, 2021/01/11
- Re: named-let, Stefan Monnier, 2021/01/11
- Re: named-let, Andrea Corallo, 2021/01/11
- Re: named-let, Stefan Monnier, 2021/01/11
- Re: named-let,
Andrea Corallo <=
- Re: named-let, Stefan Monnier, 2021/01/12
- Re: named-let, Andrea Corallo, 2021/01/12
- Re: named-let, Helmut Eller, 2021/01/12
- Re: named-let, Zhu Zihao, 2021/01/13
- Re: named-let, Stefan Monnier, 2021/01/13
- Re: named-let, Andrea Corallo, 2021/01/11
- Re: named-let, Tomas Hlavaty, 2021/01/11
- Re: named-let, Andrea Corallo, 2021/01/11
- Re: named-let, Tomas Hlavaty, 2021/01/11
Re: named-let, Stefan Monnier, 2021/01/20