[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [External] : Re: Is this a bug in while-let or do I missunderstand i
From: |
Alfred M. Szmidt |
Subject: |
Re: [External] : Re: Is this a bug in while-let or do I missunderstand it? |
Date: |
Sat, 09 Nov 2024 15:38:06 -0500 |
> If the bindings are to be reevaluated on each iteration, shouldn't B
> always be NIL, and that it would end up with (< NIL end) would be on
> each iteration causing an error?
I hope I don't miss anything important here, but I think the
first two elements in SPEC of below `while-let'
(while-let ((b)
((< b end))
(e (next-single-property-change (1+ b) 'erc--msg nil end)))
...)
do not actually bind anything, they only test. The doc string of
`if-let' has:
if-let is not while-let. If while-let is supposed to do something
weird like that .. then it should mention it. The examples in the
manual contradict the behaviour, so does the text in the manual.
>From the looks, these macros try to be way to smart.
Each element of SPEC is a list (SYMBOL VALUEFORM) that binds
SYMBOL to the value of VALUEFORM. An element can additionally be
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
of the form (VALUEFORM), which is evaluated and checked for nil;
^^^^^^^^^^^^^^^^^^^^^^^
i.e. SYMBOL can be omitted if only the test result is of
interest. It can also be of the form SYMBOL, then the binding of
SYMBOL is checked for nil.
I'd align such clauses like this:
(while-let (( b)
( (< b end))
(e (next-single-property-change (1+ b) 'erc--msg nil end)))
...)
to emphasize that.
- Sv: Is this a bug in while-let or do I missunderstand it?, (continued)
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/09
- Re: Is this a bug in while-let or do I missunderstand it?, Yuri Khan, 2024/11/09
- Sv: Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/09
- Re: Is this a bug in while-let or do I missunderstand it?, Alfred M. Szmidt, 2024/11/09
- Re: Is this a bug in while-let or do I missunderstand it?, Eli Zaretskii, 2024/11/09
- Re: Is this a bug in while-let or do I missunderstand it?, Eli Zaretskii, 2024/11/09
- Re: Is this a bug in while-let or do I missunderstand it?, Andreas Schwab, 2024/11/09
- 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?, Alfred M. Szmidt, 2024/11/09
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?, Jens Schmidt, 2024/11/09
- Re: [External] : Re: Is this a bug in while-let or do I missunderstand it?,
Alfred M. Szmidt <=
- 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