From: Stefan Kangas <stefan@marxist.se>
To: Neil Jerram <neiljerram@gmail.com>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Remove redundant 'function's around lambda
Date: Thu, 19 Nov 2020 06:51:01 -0800 [thread overview]
Message-ID: <CADwFkmn_bH0k+f50ST8cv1M4azsNmKdvXjbsDS2uHHAqmi-RFg@mail.gmail.com> (raw)
In-Reply-To: <CAKuG=vufnWctEh133-OQdUBMOtcz6dH+Nny=1ENCW4YPLoz=Tg@mail.gmail.com>
Neil Jerram <neiljerram@gmail.com> writes:
>> I've been working on removing redundant `function' around `lambda' in
>> Emacs core,
>
> I'm slightly curious about the history and reasoning around this. If I
> understand correctly, (lambda ...) on its own has always worked, and it's
> never been strictly necessary to add (quote ...) or (function ...) around
> it. Then sometime (Emacs 19 or later, I think) it started being
> recommended to use (function ...).
>
> Do you know why that recommendation started, and should I understand that
> the reasoning for it has now evaporated?
Correct, there is no reason to do this.
I don't know the history here, and there are people on emacs-devel that
would know better.
I _suspect_ that the byte-compiler first got the capability to optimize
calls to anonymous functions, but that it required to explicitly marked
as such with `function'. Later, it grew the capability to recognize
lambda as such automatically. But I don't know if that is correct; it's
just a guess. In any case, they are no longer needed as lambda and
lambda+function are equivalent.
(Note that the worst thing here is to do `(quote (lambda ...))' as that
defeats byte-compiler optimizations altogether.)
next prev parent reply other threads:[~2020-11-19 14:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-17 16:55 [PATCH] Remove redundant 'function's around lambda Stefan Kangas
2020-11-19 3:07 ` Kyle Meyer
2020-11-19 3:44 ` Stefan Kangas
2020-12-14 6:49 ` Bastien
2020-12-23 5:11 ` Kyle Meyer
2020-11-19 10:44 ` Neil Jerram
2020-11-19 14:51 ` Stefan Kangas [this message]
2020-11-19 15:16 ` Neil Jerram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADwFkmn_bH0k+f50ST8cv1M4azsNmKdvXjbsDS2uHHAqmi-RFg@mail.gmail.com \
--to=stefan@marxist.se \
--cc=emacs-orgmode@gnu.org \
--cc=neiljerram@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).