all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Greg Hendershott <mail@greghendershott.com>
Cc: emacs-devel@gnu.org
Subject: Re: [nongnu] elpa/racket-mode 363246ac70 1/2: Fix cl-loop byte-compiler warnings
Date: Mon, 18 Sep 2023 12:18:43 -0400	[thread overview]
Message-ID: <jwvcyyffof1.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <877coneerv.fsf@greghendershott.com> (Greg Hendershott's message of "Mon, 18 Sep 2023 10:29:08 -0400")

>> You can also use a silly macro
>>
>>     (defmacro my-workaround-for-cl-loop-bug65833 (var &rest body)
         (declare (indent 1) (debug (symbolp body)))
>>       (if (>= emacs-major-version 30)
>>           (macroexp-progn body)
>>         `(let (,var) ,@body)))
>
> Does that mean `cl-loop` will handle this itself in its expansion?

No, you'd have to manually wrap your `cl-loop` with

    (my-workaround-for-cl-loop-bug65833 i
      ...)

:-(

> p.s. Maybe there's even a way to address this for macros in general?

I don't think there can be.

> time to time? The theory being that such warnings are N/A and
> non-actionable to _users_ of a macro. Just maybe the author.

The macroexpander can't know whether the use of a free `i` variable is
part of the official documented behavior of the macro (and hence it's
a bug in the user's code that forgot to let-bind that var) or a bug in
the macro :-(


        Stefan




  reply	other threads:[~2023-09-18 16:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <169497000203.14597.6218117918193558526@vcs2.savannah.gnu.org>
     [not found] ` <20230917170003.62A4FC05816@vcs2.savannah.gnu.org>
2023-09-17 18:09   ` [nongnu] elpa/racket-mode 363246ac70 1/2: Fix cl-loop byte-compiler warnings Stefan Monnier
2023-09-18 14:29     ` Greg Hendershott
2023-09-18 16:18       ` Stefan Monnier [this message]
2023-09-18 18:46         ` Greg Hendershott
2023-09-18 20:36           ` Stefan Monnier

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=jwvcyyffof1.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=mail@greghendershott.com \
    /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.