bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#69533: 30.0.50; Wrong byte compilation of a certain apply syntax


From: Michael Heerdegen
Subject: bug#69533: 30.0.50; Wrong byte compilation of a certain apply syntax
Date: Mon, 04 Mar 2024 09:10:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

"Basil L. Contovounesios" <basil@contovou.net> writes:

> Just curious: which convention are you referring to, and why do you
> say it's new?

The convention that (apply (F . ARGS)) == (apply F . ARGS).

>  AFAICT the only recent Emacs version which accepted
> (apply '(+ 1 2)) without any complaint is Emacs 28.

So it is quite new.

> FWIW, my guilty pleasure is using this calling convention with
> a non-literal form, e.g.:
>
>   (define-advice foo (:around (&rest args) my-foo)
>     (with-something (apply args)))
>
> This has always byte-compiled without issue.

Aha - a user!

No, `byte-optimize-apply' does not mess up this case:

  (byte-optimize-apply '(apply args)) --> (apply args)

so it will compile just fine but

  (byte-optimize-apply '(apply '(+ 1 2)))
   --> (funcall '(+ 1 2) '+ '1 '2) ; broken

That the byte compiler result is (sometimes) broken is a bug in the
optimization code, not in the compiler itself.

Michael.





reply via email to

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