emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nongnu] elpa/racket-mode 363246ac70 1/2: Fix cl-loop byte-compiler


From: Stefan Monnier
Subject: Re: [nongnu] elpa/racket-mode 363246ac70 1/2: Fix cl-loop byte-compiler warnings
Date: Mon, 18 Sep 2023 12:18:43 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

>> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]