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: Sun, 17 Sep 2023 14:09:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

>     Fix cl-loop byte-compiler warnings
>     
>     Frustratingly, the work-around of introducing a dummy `let` binding
>     for the cl-loop index variable works on older versions of Emacs... but
>     on bleeding edge Emacs starting c. a week ago starts to cause a
>     different warning unless the variable is used.

I plead guilty.  Sorry 'bout that.

Note that your workaround for the workaround could receive a warning in
the future (that code looks very odd and we were recently talking about
adding warnings for such unusual codes where an expression whose return
value is ignored consist in just a constant or a variable lookup).

So you might like to pass your dummy references to `i` to `ignore`,
which is the "standard" idiom to say "don't bother warning me if I don't
use this variable" and which the compiler already treats specially.

>     So to make this work across all versions (so far) of Emacs, we need a
>     work-around for the work-around.

The upside is that you should be able to drop the workaround as soon as
you don't need to support Emacs<30 any more :-)

You can also use a silly macro

    (defmacro my-workaround-for-cl-loop-bug65833 (var &rest body)
      (if (>= emacs-major-version 30)
          (macroexp-progn body)
        `(let (,var) ,@body)))


-- Stefan




reply via email to

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