From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, 52063@debbugs.gnu.org
Subject: bug#52063: 28.0.60; Confusing presentation of lambda
Date: Wed, 24 Nov 2021 15:08:38 -0500 [thread overview]
Message-ID: <jwva6htqqch.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83v90h72ki.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 Nov 2021 21:53:33 +0200")
>> No, but in 99% of the cases you won't actually *see* a function value
>> (unless you specifically go looking for it, e.g. with `symbol-function`).
> We also have gobs of variables that are not hooks, which accept
> function values.
Indeed, tho I think there are a few more such hooks and at least I have
looked at hook values a lot more often than I have looked at
<foo>-function values.
> And we also have menu items and mode-line constructs
> that sometimes use anonymous functions.
I think it's very rare for a user to look at those objects.
> And timer functions.
I can't remember the last time I looked at such a value. And given the
extra info attached to it, it's not very legible so I don't think people
are affected very much by a change in the actual function
representation there.
> And process filter and sentinel functions.
Same here: you will often set them, but very rarely will you actually
look at their value.
> And that's just 5 sec of thinking where one could meet them.
Indeed, there are many more places.
>> So you'll only get a value of the form (lambda ARGS . BODY) if you use
>> the dynamically scoped dialect of ELisp (or if you manually create such
>> a list, e.g. with '(lambda ...) or `(lambda ...) or (list 'lambda ...),
>> etc...).
>
> So I guess the warning about quoting lambdas with ' instead of #' is
> actually misleading people into getting these closures instead of the
> lambdas they might expect?
A value (lambda ...) is fundamentally a list. The rest of the system
(e.g. the byte-compiler, flymake, ...) can't know if you intend to use
this list as a function, so it can't really look inside to compile its
body, warn you about typos in its body, or uses of obsolete
vars/functions, etc...
> So why do we emit those warnings for Lisp code evaluated from a file
> that doesn't have lexical-binding setting in it?
Those warnings predate the introduction of lexical scoping, indeed.
They're mostly there so you don't mistakenly write code which the
byte-compiler can't compile (and which `flymake` can't analyze to give
you further feedback about issues in that code).
It's all about the difference between code and data ;-)
Stefan
next prev parent reply other threads:[~2021-11-24 20:08 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 18:56 bug#52063: 28.0.60; Confusing presentation of lambda Eli Zaretskii
2021-11-24 7:35 ` Lars Ingebrigtsen
2021-11-24 12:48 ` Eli Zaretskii
2021-11-24 12:51 ` Lars Ingebrigtsen
2021-11-24 13:15 ` Eli Zaretskii
2021-11-24 13:31 ` Lars Ingebrigtsen
2021-11-24 14:38 ` Eli Zaretskii
2021-11-24 16:21 ` Lars Ingebrigtsen
2021-11-24 16:33 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 16:54 ` Eli Zaretskii
2021-11-24 17:19 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 17:44 ` Eli Zaretskii
2021-11-24 19:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 19:53 ` Eli Zaretskii
2021-11-24 20:08 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-11-24 20:14 ` Eli Zaretskii
2021-11-24 22:02 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 22:33 ` Jim Porter
2021-11-24 22:42 ` Jim Porter
2021-11-24 21:10 ` Eduardo Ochs
2021-11-24 16:40 ` Filipp Gunbin
2021-11-24 16:54 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 18:18 ` Filipp Gunbin
2021-11-24 19:08 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 19:41 ` Eli Zaretskii
2021-11-24 19:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 19:59 ` Eli Zaretskii
2021-11-24 20:23 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 22:37 ` Gregory Heytings
2021-11-25 0:09 ` Filipp Gunbin
2021-11-25 8:57 ` Michael Heerdegen
2021-11-25 13:09 ` Lars Ingebrigtsen
2021-11-25 14:08 ` Michael Heerdegen
2021-11-25 14:39 ` Gregory Heytings
2021-11-24 20:16 ` Philipp Stephani
2021-11-24 21:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-25 0:13 ` Filipp Gunbin
2021-11-25 13:15 ` Lars Ingebrigtsen
2021-11-25 19:07 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-25 19:56 ` Jim Porter
2021-11-26 12:28 ` Lars Ingebrigtsen
2021-11-26 12:26 ` Lars Ingebrigtsen
2021-11-26 13:13 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-26 13:22 ` Lars Ingebrigtsen
2021-11-26 13:26 ` Lars Ingebrigtsen
2021-11-26 14:57 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-26 15:00 ` Lars Ingebrigtsen
2021-11-26 16:58 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-27 14:17 ` Lars Ingebrigtsen
2021-11-27 15:28 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-29 13:54 ` Lars Ingebrigtsen
2021-11-29 17:58 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-30 14:07 ` Michael Heerdegen
2021-11-30 14:20 ` Lars Ingebrigtsen
2021-11-24 16:56 ` Eli Zaretskii
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwva6htqqch.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=52063@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
/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.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).