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

Full log


View this message in rfc822 format

From: JD Smith <jdtsmith <at> gmail.com>
To: 61743 <at> debbugs.gnu.org
Subject: bug#61743: 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 2 years and 117 days ago.

Previous Next


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