[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: |
John ff |
Subject: |
Re: Is this a bug in while-let or do I missunderstand it? |
Date: |
Thu, 14 Nov 2024 21:50:18 +0000 |
User-agent: |
Android |
-------- Original Message --------
From: Eli Zaretskii <eliz@gnu.org>
Sent: Sat Nov 09 16:44:28 GMT 2024
To: "Alfred M. Szmidt" <ams@gnu.org>
Cc: yuri.v.khan@gmail.com, arthur.miller@live.com, emacs-devel@gnu.org
Subject: Re: Is this a bug in while-let or do I missunderstand it?
> From: "Alfred M. Szmidt" <ams@gnu.org>
> Cc: arthur.miller@live.com, emacs-devel@gnu.org
> Date: Sat, 09 Nov 2024 11:33:45 -0500
>
> (while-let ((run (some-condition)))
> (message "running"))
>
> Do you expect that to evaluate (some-condition) once, then, if it’s
> initially true, run forever?
>
> That is how it is described in the manual, so yes (some-condition)
> should only be done once, and not every iteration. See (elisp)
> Conditionals .
Which could mean that the manual is wrong and needs to be fixed.
> It can be convenient to bind variables in conjunction with using a
> conditional. It's often the case that you compute a value, and then
> want to do something with that value if it's non-‘nil’. The
> straightforward way to do that is to just write, for instance:
>
> (let ((result1 (do-computation)))
> (when result1
> (let ((result2 (do-more result1)))
> (when result2
> (do-something result2)))))
>
> Since this is a very common pattern, Emacs provides a number of
> macros to make this easier and more readable. The above can be written
> the following way instead:
>
> ... following the various with various FOO-let forms, ending with
> while-let.
The above description actually supports what Yuri was saying, not what
Arthur and you expect.
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?, (continued)
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Joost Kremers, 2024/11/09
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Alfred M. Szmidt, 2024/11/10
- Re: Better documentation for non-binding clauses of if-let and friends, Jens Schmidt, 2024/11/10
- Re: Better documentation for non-binding clauses of if-let and friends, Sean Whitton, 2024/11/10
- Re: Better documentation for non-binding clauses of if-let and friends, Jens Schmidt, 2024/11/10
- Re: Better documentation for non-binding clauses of if-let and friends, Alfred M. Szmidt, 2024/11/11
- Re: Better documentation for non-binding clauses of if-let and friends, Alfred M. Szmidt, 2024/11/11
- Sv: [External] : Re: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/10
- RE: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Drew Adams, 2024/11/09
- RE: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Drew Adams, 2024/11/09
- Re: Is this a bug in while-let or do I missunderstand it?,
John ff <=
- 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, 2024/11/11
- 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