unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#61743: cl-loop's "being the intervals of" does not let-bind var
@ 2023-02-23 22:44 JD Smith
  0 siblings, 0 replies; only message in thread
From: JD Smith @ 2023-02-23 22:44 UTC (permalink / raw)
  To: 61743

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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-23 22:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 22:44 bug#61743: cl-loop's "being the intervals of" does not let-bind var JD Smith

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).