[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: |
Sat, 09 Nov 2024 22:47:55 +0100 |
On Sat, Nov 09 2024, arthur miller wrote:
> 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.
Yes, but for `while`, the pattern isn't complete. The `setq` inside the
loop is a crucial part:
```
(let ((a (foo ...)))
(while a
(do-stuff-with a)
(setq a (foo ...))))
```
So the idea is that you want to test the result of some expression on each
iteration. `while-let` basically lets you type that expression only once,
instead of twice.
At least that's how I understand `while-let`.
--
Joost Kremers
Life has its moments
- 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?, Joost Kremers, 2024/11/13
- 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?, Eli Zaretskii, 2024/11/14
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/14
- Re: Is this a bug in while-let or do I missunderstand it?, Sean Whitton, 2024/11/20
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/24
- Re: Is this a bug in while-let or do I missunderstand it?, Sean Whitton, 2024/11/24
- Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/25
- Re: Is this a bug in while-let or do I missunderstand it?, John ff, 2024/11/14
- Re: Is this a bug in while-let or do I missunderstand it?, John ff, 2024/11/14
- Re: Sv: Is this a bug in while-let or do I missunderstand it?,
Joost Kremers <=
- Sv: 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?, Andreas Schwab, 2024/11/10
Re: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/12
Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/13
Re: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/12