* bug#65833: 30.0.50; cl-loop on the intervals uses global var
@ 2023-09-08 20:57 Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
[not found] ` <handler.65833.B.169420666830800.ack@debbugs.gnu.org>
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-08 20:57 UTC (permalink / raw)
To: 65833
Package: Emacs
Version: 30.0.50
ELISP> (macroexpand '(cl-loop for X being the intervals of B do
(FOO)))
(cl--block-wrapper
(catch '--cl-block-nil--
(cl-block --cl-finish--
(cl--map-intervals
(lambda (--cl-var1-- --cl-var2--)
(setq X (cons --cl-var1-- --cl-var2--))
(FOO))
B nil nil nil))
nil))
As you can see, this sets fails to declare `X` as being a local
variable, so it will affect `X` from the surrounding context.
This looping form doesn't exist in Common Lisp, but `for X being` never
behaves like that, so this is clearly a bug.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#65833: 30.0.50; cl-loop on the intervals uses global var
[not found] ` <handler.65833.B.169420666830800.ack@debbugs.gnu.org>
@ 2023-09-09 2:18 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-09 2:18 UTC (permalink / raw)
To: GNU bug Tracking System; +Cc: 65833-done
I pushed a fix for it to `master`.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-09 2:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08 20:57 bug#65833: 30.0.50; cl-loop on the intervals uses global var Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
[not found] ` <handler.65833.B.169420666830800.ack@debbugs.gnu.org>
2023-09-09 2:18 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).