From: Drew Adams <drew.adams@oracle.com>
To: Jim Porter <jporterbugs@gmail.com>, Po Lu <luangruo@yahoo.com>,
Dmitry Gutov <dmitry@gutov.dev>
Cc: Eli Zaretskii <eliz@gnu.org>,
"66706@debbugs.gnu.org" <66706@debbugs.gnu.org>,
"mattias.engdegard@gmail.com" <mattias.engdegard@gmail.com>,
"stefankangas@gmail.com" <stefankangas@gmail.com>,
Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#66706: [PATCH] Automatic elisp dialect insertion
Date: Thu, 26 Oct 2023 02:28:25 +0000 [thread overview]
Message-ID: <SJ0PR10MB54883053F71632BF85C51A72F3DDA@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <c5c3f0f0-d9f7-417c-8290-6966d7ee5bba@gmail.com>
> In particular, what's missing from the following paragraph[1]?
>
> > Another way to think about let is that it is like a setq that is
> temporary and local. The values set by let are automatically undone when
> the let is finished. The setting only affects expressions that are inside
> the bounds of the let expression. In computer science jargon, we would say
> the binding of a symbol is visible only in functions called in the let
> form; in Emacs Lisp, the default scoping is dynamic, not lexical. (The
> non-default lexical binding is not discussed in this manual.)
This bit would be far off-base for a description
of lexical let-binding:
when the let is finished
^^^^ ^^^^^^^^
That's excusable for the Intro Lisp manual back
when Elisp had only dynamic binding. It fits only
dynamic, not lexical, let-binding.
A description of a lexical let binding should talk
about lexical scope - a limit you can see "on the
page" (it's lexical) - a limit on "where" in code,
not "when" in code evaluation.
"Finished" is nearly as bad (for lexical binding),
as it has a (strong) connotation of process/time.
For lexical binding it's about where the let sexp
ends, not when let processing finishes.
OTOH, "local" _is_ pertinent for lexical, but it's
about being local _lexically_: local means inside
the let sexp. A lexical binding doesn't exist
outside that scope.
And this bit is not true for dynamic binding:
The setting only affects expressions that are
inside the bounds of the let expression.
It affects expressions that are evaluated within
the extent (time) of the dynamic let binding.
There's _no_ limit on the scope, dynamically -
it's indefinite: anything, anywhere, can refer to
a thing that's dynamically bound.
If looking for a clear and palatable description
then let me suggest starting with the way lexical
and dynamic binding are presented in CLTL2:
https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node43.html#SECTION00700000000000000000
And from the moment the language has both lexical
and dynamic binding (as it does now), a description
of let needs to also get into the fact that it can
bind dynamic (special) variables also - the overall
behavior is more complicated to describe because of
that.
next prev parent reply other threads:[~2023-10-26 2:28 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 17:46 bug#66706: [PATCH] Automatic elisp dialect insertion Mattias Engdegård
2023-10-23 18:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-23 18:44 ` Eli Zaretskii
2023-10-23 19:21 ` Stefan Kangas
2023-10-23 20:20 ` Mattias Engdegård
2023-10-24 17:31 ` Mattias Engdegård
2023-10-24 18:25 ` Eli Zaretskii
2023-10-24 19:19 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-24 20:22 ` Stefan Kangas
2023-10-25 2:31 ` Eli Zaretskii
2023-10-25 11:56 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 12:17 ` Stefan Kangas
2023-10-25 12:54 ` Dmitry Gutov
2023-10-26 0:31 ` Michael Heerdegen
2023-10-26 6:35 ` Eli Zaretskii
2023-10-27 3:14 ` Michael Heerdegen
2023-10-27 6:26 ` Eli Zaretskii
2023-10-27 7:24 ` Michael Heerdegen
2023-10-27 7:32 ` Eli Zaretskii
2023-10-27 14:41 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-29 12:26 ` Eli Zaretskii
2023-10-25 0:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 1:20 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 2:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 3:01 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 11:48 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 12:46 ` Dmitry Gutov
2023-10-25 12:48 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 14:56 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 16:04 ` Eli Zaretskii
2023-10-26 0:01 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 12:03 ` Eli Zaretskii
2023-10-25 13:06 ` Dmitry Gutov
2023-10-25 13:20 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 13:40 ` Dmitry Gutov
2023-10-26 0:07 ` Jim Porter
2023-10-26 0:40 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26 0:51 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26 1:19 ` Jim Porter
2023-10-26 1:41 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26 3:48 ` Jim Porter
2023-10-26 5:56 ` Jim Porter
2023-10-26 7:09 ` Eli Zaretskii
2023-10-26 2:37 ` Drew Adams
2023-10-26 2:28 ` Drew Adams [this message]
2023-10-26 5:21 ` Eli Zaretskii
2023-10-25 13:57 ` Eli Zaretskii
2023-10-25 15:11 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 16:08 ` Eli Zaretskii
2023-10-25 16:10 ` Dmitry Gutov
2023-10-25 16:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26 0:02 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 18:19 ` Mattias Engdegård
2023-10-25 18:40 ` Eli Zaretskii
2023-10-25 19:09 ` Mattias Engdegård
2023-10-25 23:43 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26 0:07 ` Jim Porter
2023-10-26 2:34 ` Drew Adams
2023-10-26 3:56 ` Jim Porter
2023-10-26 5:22 ` Eli Zaretskii
2023-10-26 6:31 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26 13:54 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26 14:02 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26 15:35 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26 8:32 ` Mattias Engdegård
2023-10-26 11:39 ` Nikolay Kudryavtsev
2023-10-26 15:36 ` Drew Adams
2023-10-25 12:36 ` Nikolay Kudryavtsev
2023-10-25 12:48 ` Dmitry Gutov
2023-10-26 11:06 ` Nikolay Kudryavtsev
2023-10-25 2:27 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0PR10MB54883053F71632BF85C51A72F3DDA@SJ0PR10MB5488.namprd10.prod.outlook.com \
--to=drew.adams@oracle.com \
--cc=66706@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=eliz@gnu.org \
--cc=jporterbugs@gmail.com \
--cc=luangruo@yahoo.com \
--cc=mattias.engdegard@gmail.com \
--cc=monnier@iro.umontreal.ca \
--cc=stefankangas@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.