[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is this a bug in while-let or do I missunderstand it?
From: |
Yuri Khan |
Subject: |
Re: Is this a bug in while-let or do I missunderstand it? |
Date: |
Mon, 11 Nov 2024 12:13:45 +0700 |
On Mon, 11 Nov 2024 at 01:18, arthur miller <arthur.miller@live.com> wrote:
> As I understand it now, Emacs while-loop is a unique kind of loop, at least
> I have never seen a construction with such semantic before. The semantic
> of while-let in Emacs is that of for-loop or while-loop in C++, but where
> initialization of loop variables happens on each iteration
>
> for (int i=0; i<some_bound(); i++) {
> we can read i here, but
> we can't write to it
> }
Comprarison with a for loop is somewhat strained here. The while-let
loop in Elisp is directly analogous to this C++ while loop:
#include <iostream>
int main() {
while (bool run = true) {
std::cout << "running\n";
run = false;
}
std::cout << "out of loop\n";
}
and yes, it’s an infloop, too.
What you’re looking for, though, seems to be a while loop with a
break, which is expressed as a catch/throw in Elisp.
- Sv: [External] : Re: Is this a bug in while-let or do I missunderstand it?, (continued)
- Re: Is this a bug in while-let or do I missunderstand it?, John ff, 2024/11/14
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Eli Zaretskii, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?, Alfred M. Szmidt, 2024/11/10
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- Re: Is this a bug in while-let or do I missunderstand it?,
Yuri Khan <=
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/11
- Re: Sv: Is this a bug in while-let or do I missunderstand it?, tomas, 2024/11/11
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/11
- Re: Is this a bug in while-let or do I missunderstand it?, Eli Zaretskii, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Eli Zaretskii, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/12
- Re: Is this a bug in while-let or do I missunderstand it?, Sean Whitton, 2024/11/13
- Re: Is this a bug in while-let or do I missunderstand it?, Sean Whitton, 2024/11/13