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: "Basil L. Contovounesios" <basil <at> contovou.net>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 69533 <at> debbugs.gnu.org, Mattias Engdegård <mattiase <at> acm.org>
Subject: bug#69533: 30.0.50; Wrong byte compilation of a certain apply syntax
Date: Mon, 04 Mar 2024 13:52:55 +0100
Andreas Schwab [2024-03-04 10:39 +0100] wrote:

> On Mär 04 2024, Basil L. Contovounesios wrote:
>
>> Just curious: which convention are you referring to, and why do you say
>> it's new?  AFAICT the only recent Emacs version which accepted
>> (apply '(+ 1 2)) without any complaint is Emacs 28.
>
> It was added in commit 8edd4a2b64e, since Emacs 24.

Right, but that doesn't mean literal forms survive byte-compilation:

  $ cd "$(mktemp -d)"
  $ cat << EOF > foo.el
  > ; -*- lexical-binding: t -*-
  > (message "%s" (apply '(1+ 0)))
  > EOF
  $ emacs-24.5 -Q -batch -f batch-byte-compile foo.el

  In toplevel form:
  foo.el:2:1:Warning: `(1+ 0)' is a malformed function
  Wrote /tmp/tmp.aFbeBGQj7q/foo.elc
  $ emacs-24.5 -Q -script foo.elc
  Invalid function: (1+ 0)

By contrast:

  $ emacs-28.2 -Q -batch -f batch-byte-compile foo.el
  $ emacs-28.2 -Q -script foo.elc
  1

-- 
Basil




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.