emacs-devel
[Top][All Lists]
Advanced

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

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


From: arthur miller
Subject: Sv: Is this a bug in while-let or do I missunderstand it?
Date: Sat, 9 Nov 2024 13:47:07 +0000

>> least very unintuitive behaviour.
>
>Why? Pretty much all implementations of the ‘while’ loop in all
>languages I’ve seen re-evaluate the condition on every iteration.

That wasn't the un-intuitive part :-).

If it wasn't clear, the unintuitive part is that while-let was to
establish the local environment, so that we don't need to type:

(let ((som-var (init-form)))
    (while some-var
        ... ))

At least is how I understand the purpose of if-let, when-let and while-let.

Från: Yuri Khan <yuri.v.khan@gmail.com>
Skickat: den 9 november 2024 14:41
Till: arthur miller <arthur.miller@live.com>
Kopia: emacs-devel@gnu.org <emacs-devel@gnu.org>
Ämne: Re: Is this a bug in while-let or do I missunderstand it?
 
On Sat, 9 Nov 2024 at 20:38, arthur miller <arthur.miller@live.com> wrote:

> >I expect the binding is writable *but* it gets re-assigned on each iteration.
>
> Yes.
> I have already posted the macro expansions in respone to Phillip.
> It is quite clear what is going on. I think it is a bug, or at
> least very unintuitive behaviour.

Why? Pretty much all implementations of the ‘while’ loop in all
languages I’ve seen re-evaluate the condition on every iteration.

reply via email to

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