[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: |
Sat, 9 Nov 2024 20:15:39 +0700 |
On Sat, 9 Nov 2024 at 20:03, arthur miller <arthur.miller@live.com> wrote:
>
> >> (progn
> >> (while-let ((run t))
> >> (message "Running")
> >> (setf run nil))
> >> (message "out of loop"))
> >>
> >> It ends in infinite recursion. setf/setq have no effect on the lexical
> >> variable.
> >
> >Probably not infinite recursion but infinite loop.
> >
> >Why would you expect anything else? ‘while-let’ is documented as:
> >
> > Bind variables according to SPEC and conditionally evaluate BODY.
>
> What should I expect?
>
> It does not says *read-only bindings*, it says bindings. Is it
> unreasonable to store a value in an established lexical binding?
I expect the binding is writable *but* it gets re-assigned on each iteration.
> (progn
> (let ((run t))
> (while run
> (message "running")
> (setf run nil))
> (message "not running")))
>
> That is what I expect while-let to be equivalent to.
This is what I expect:
(progn
(let ((run))
(while (setf run t)
(message "running")
(setf run nil) ; useless because ‘run’ will be
reassigned right next
)
(message "not running") ; unreachable
)
- Is this a bug in while-let or do I missunderstand it?, arthur miller, 2024/11/08
- Re: Is this a bug in while-let or do I missunderstand it?, Philip Kaludercic, 2024/11/08
- 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?,
Yuri Khan <=
- 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?, 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