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: Eli Zaretskii
Subject: bug#69533: 30.0.50; Wrong byte compilation of a certain apply syntax
Date: Thu, 14 Mar 2024 09:52:52 +0200

> Date: Mon, 04 Mar 2024 02:51:42 +0100
> From:  Michael Heerdegen via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> 
> Hello,
> 
> C-h f apply says:
> 
> | ...
> | With a single argument, call the argument's first element using the
> | other elements as args.
> 
> Issue 1:  This doc sentence has to be moved after the following example,
> because that example:
> 
> | Thus, (apply '+ 1 2 '(3 4)) returns 10.
> 
> is an example for the more widespread syntax.
> 
> That sentence actually explains a special case: it tells that this is
> also allowed:
> 
>   (apply '(+ 1 2)) ==> 3
> 
> 
> Issue 2: The byte compiler currently miscompiles such expressions:
> 
> Expected:
> 
>   (funcall (lambda () (apply '(+ 1 2)))) ==> 3
> 
> but
> 
>   (funcall (byte-compile '(lambda () (apply '(+ 1 2)))))
>    ~~> Error: Invalid function: (+ 1 2)
> 
> AFAIU this is `byte-optimize-apply's fault:
> 
> (byte-optimize-apply '(apply '(+ 1 2)))
>  ==> (funcall '(+ 1 2) '+ '1 '2) ; Ouch!
> 

Stefan and Mattias, any comments or suggestions?





reply via email to

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