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: Drew Adams <drew.adams <at> oracle.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>, "69533 <at> debbugs.gnu.org" <69533 <at> debbugs.gnu.org>
Cc: "rms <at> gnu.org" <rms <at> gnu.org>
Subject: bug#69533: 30.0.50; Wrong byte compilation of a certain apply syntax
Date: Mon, 4 Mar 2024 03:39:46 +0000
> | With a single argument, call the argument's
> | first element using the other elements as args.

> ...
> That sentence actually explains a special case:
> it tells that this is also allowed:
>   (apply '(+ 1 2)) ==> 3

FWIW, I'm very surprised to find this "feature".
That it's documented suggests it was intended.
But I don't know why it would be.  Does anyone?
What's the use case for not requiring the first
arg to be a function?

No Lisp that I'm aware of, starting with Lisp 1,
has ever supported such a feature - at least not
according to its doc.

Ccing RMS, who might know why, if this has been
in Elisp since Day One or it was added long ago.
___

Aha, I see now - found it.  It was added in Emacs
28.1.

And this text was added then to the Elisp manual:

  ‘apply’ with a single argument is special:
  the first element of the argument, which
  must be a non-empty list, is called as a
  function with the remaining elements as
  individual arguments.  Passing two or more
  arguments will be faster.

And this additional example was added there:

    (apply '(+ 3 4))
         ⇒ 7

But why?  There's nothing in NEWS about this.
Was it even discussed? (Probably, but maybe
only in a bug thread?)

None of the rest of the text is changed -
just what I've mentioned here.

I don't understand why anyone considered it
a good idea to change the behavior of `apply'
(in this way or in any other way).  What
gives?

"Special" is indeed one way to characterize
it.  More like "shocking". ;-)  What's next?

And this bug is about the behavior not even
faithfully reflecting that doc?  Sheesh.

Was this done on April 1?




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.