Stefan Monnier via Users list for the GNU Emacs text editor
<[email protected]> writes:
>
>> The description for ‘named-let’ says that recursive calls in the tail
>> position are guaranteed to be optimized tail calls, while the
>> description for ‘cl-labels’ does not mention this.
>> Is this not the case for ‘cl-labels’, too?
>
> No and yes:
>
> - No, that guarantee does not hold for `cl-labels`.
> - Yes, `cl-labels` optimizes tail-calls just as well as `named-let`
> (simply because `named-let`s tail-call-optimization is actually
> implemented in `cl-labels`), but that covers only those `cl-labels`
> that define a single function (hence, it's not guaranteed in general
> for `cl-labels`).
>
Thank you for the distinction.
>> (info "(cl) Function Bindings")
>>
>> Also, the Emacs Lisp reference manual describes ‘named-let’
>> as a special form (like ‘if’), while its docstring describes
>> it as a macro. Is this an error in the reference manual?
>
> Sounds like it, yes.
>
Reported as <bug#81004>.
--
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.