GNU bug report logs - #69533
30.0.50; Wrong byte compilation of a certain apply syntax

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Mon, 4 Mar 2024 01:52:02 UTC

Severity: normal

Found in version 30.0.50

Done: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Subject: bug#69533: closed (Re: bug#69533: 30.0.50; Wrong byte compilation
 of a certain apply syntax)
Date: Mon, 04 Mar 2024 13:28:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 69533 <at> debbugs.gnu.org.

-- 
69533: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69533
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: "Basil L. Contovounesios" <basil <at> contovou.net>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>,
 Andreas Schwab <schwab <at> suse.de>, 69533-done <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#69533: 30.0.50; Wrong byte compilation of a certain apply
 syntax
Date: Mon, 4 Mar 2024 14:25:50 +0100
> This was probably just a mistake of mine; a `<=` should have been `<`.

Actually `>=` should have been `>`.
Pushed to master; closing the bug.


[Message part 3 (message/rfc822, inline)]
From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Wrong byte compilation of a certain apply syntax
Date: Mon, 04 Mar 2024 02:51:42 +0100
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.



This bug report was last modified 1 year and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.