all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 65833@debbugs.gnu.org
Subject: bug#65833: 30.0.50; cl-loop on the intervals uses global var
Date: Fri, 08 Sep 2023 16:57:18 -0400	[thread overview]
Message-ID: <jwvh6o4jscx.fsf@iro.umontreal.ca> (raw)

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	other threads:[~2023-09-08 20:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 20:57 Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
     [not found] ` <handler.65833.B.169420666830800.ack@debbugs.gnu.org>
2023-09-09  2:18   ` 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvh6o4jscx.fsf@iro.umontreal.ca \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65833@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.