[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: |
Drew Adams |
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?