GNU bug report logs - #61743
cl-loop's "being the intervals of" does not let-bind var

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Thu, 23 Feb 2023 22:46:02 UTC

Severity: normal

To reply to this bug, email your comments to 61743 AT debbugs.gnu.org.

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#61743; Package emacs. (Thu, 23 Feb 2023 22:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to JD Smith <jdtsmith <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 23 Feb 2023 22:46:02 GMT) Full text and rfc822 format available.

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

From: JD Smith <jdtsmith <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: cl-loop's "being the intervals of" does not let-bind var
Date: Thu, 23 Feb 2023 17:44:51 -0500
Macro-expanding the following reveals that the “being the intervals” cl-loop construct fails to let-bind the loop var (i here):

  (cl-loop for i being the intervals of x do (ignore))

expanding to:

(cl-block nil
  (cl-block --cl-finish--
    (cl--map-intervals
     (lambda
       (--cl-var1-- --cl-var2--)
       (setq i
	     (cons --cl-var1-- --cl-var2--))
       (ignore))
     x nil nil nil))
  nil)

This leads to the loop altering global variables.  Emacs v28.2



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

Previous Next


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