all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#69533: 30.0.50; Wrong byte compilation of a certain apply syntax
@ 2024-03-04  1:51 Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-03-04  3:39 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-03-04  1:51 UTC (permalink / raw)
  To: 69533


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!


TIA,

Michael.





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-03-14 11:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04  1:51 bug#69533: 30.0.50; Wrong byte compilation of a certain apply syntax Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-04  3:39 ` Drew Adams
2024-03-04  4:40   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-04 15:52     ` Drew Adams
2024-03-04  5:13 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-04  7:46   ` Basil L. Contovounesios
2024-03-04  8:10     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-04  8:47       ` Basil L. Contovounesios
2024-03-04  8:17     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-04  8:48       ` Basil L. Contovounesios
2024-03-04  9:39     ` Andreas Schwab
2024-03-04 12:52       ` Basil L. Contovounesios
2024-03-04 13:13         ` Mattias Engdegård
2024-03-04 13:25           ` Mattias Engdegård
2024-03-04 21:12             ` Drew Adams
2024-03-14  7:52 ` Eli Zaretskii
2024-03-14  8:44   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-14 11:13     ` Eli Zaretskii
2024-03-14 11:18       ` Mattias Engdegård

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.