emacs-devel
[Top][All Lists]
Advanced

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

Re: Sv: Is this a bug in while-let or do I missunderstand it?


From: Joost Kremers
Subject: Re: Sv: Is this a bug in while-let or do I missunderstand it?
Date: Wed, 13 Nov 2024 00:31:55 +0100
User-agent: mu4e 1.12.7; emacs 29.4

On Tue, Nov 12 2024, arthur miller wrote:
>>> The scope of the let-binding is the same in both.
>>
>>   I don't see how. With `while`, `result` is let-bound outside the loop, with
>>   `while-let` it's bound inside the loop, even after macroexpanding it:
>>
>>And that is (again) the crux of the matter, one group thinks it is LET
>>bound outside of the loop, another inside.
>
> Yepp, you have put a finger on it.
>
> It is not so strange we have two views. It is a let-over-while that expands
> into while-over-let :-).

It's not a let-over-while. The let-over-while snippet was just used to
explain why the macro was introduced, but (as you mention) it's misleading.
That's why in my first proposal for the documentation, I mentioned the
difference in scope explicitly. I've now taken that part out again, though,
and am trying to explain `while-let` on its own, without reference to
the `while` pattern it replaces.

-- 
Joost Kremers
Life has its moments



reply via email to

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