GNU bug report logs - #65833
30.0.50; cl-loop on the intervals uses global var

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Fri, 8 Sep 2023 20:58:01 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65833 in the body.
You can then email your comments to 65833 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#65833; Package emacs. (Fri, 08 Sep 2023 20:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 08 Sep 2023 20:58:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; cl-loop on the intervals uses global var
Date: Fri, 08 Sep 2023 16:57:18 -0400
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





Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Sat, 09 Sep 2023 02:19:01 GMT) Full text and rfc822 format available.

Notification sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
bug acknowledged by developer. (Sat, 09 Sep 2023 02:19:02 GMT) Full text and rfc822 format available.

Message #10 received at 65833-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: help-debbugs <at> gnu.org (GNU bug Tracking System)
Cc: 65833-done <at> debbugs.gnu.org
Subject: Re: bug#65833: 30.0.50; cl-loop on the intervals uses global var
Date: Fri, 08 Sep 2023 22:18:29 -0400
I pushed a fix for it to `master`.


        Stefan





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 07 Oct 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.