From: Richard Stallman <rms@gnu.org>
To: Jim Porter <jporterbugs@gmail.com>
Cc: eliz@gnu.org, 66756@debbugs.gnu.org
Subject: bug#66756: 30.0.50; [PATCH] Improve discussion of 'let' in Elisp Introduction manual
Date: Sun, 03 Dec 2023 22:08:37 -0500 [thread overview]
Message-ID: <E1r9zK1-0003MB-PT@fencepost.gnu.org> (raw)
In-Reply-To: <0fe9fc29-11d5-2983-8970-3f4b7969df2d@gmail.com> (message from Jim Porter on Thu, 30 Nov 2023 13:03:52 -0800)
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> +means his house, not yours. (Symbols used in argument lists work the
> +same way.
Maybe that sentence should be more explicit about which symbols it
refers to and which aspect of "working". Perhaps like this:
(The symbols used to name function arguments are bound as local variables
in exactly the same way.)
This statement
However, outside
+of the @code{let} body (such as when calling a function that was
+defined elsewhere), calling @code{setq} for a variable named by the
+@code{let} expression will @emph{not} affect that local variable.
is true only in lexical binding. With dynamic binding, such a setq
_will_ set the let's local variable (in the simplest cases).
+Emacs Lisp supports two different ways of binding variable names to
+their values. These ways affect the parts of your program where a
+particular binding is validscop.
Typo there.
+As we discussed before, when you create local variables with
+@code{let} under lexical binding, those variables are valid only
+within the body of the @code{let} expression.
Where is this previous discussion? I don't see it. The distinction
of dynamic vs lexical was first introduced two paragraphs above,
and its effects on binding have not been discussed yet.
Is this a reference to the following?
However, outside
+of the @code{let} body (such as when calling a function that was
+defined elsewhere), calling @code{setq} for a variable named by the
+@code{let} expression will @emph{not} affect that local variable.
That may be meant as a discussion of local binding with lexical scoping,
but it isn't one, since it doesn't say "lexical scoping."
(On the other hand, if
+you call a function defined within a @code{let} body,
I recommend "that was defined within"; it is more clear.
+Under dynamic binding, the rules are different: instead, when you use
+@code{let}, the local variables you've created are valid during
+execution of the let expression.
@code needed here.
When you bind a variable
+with @code{let}, it puts the new binding you've specified on the top
+of the stack,
For clarity, I suggest "bind a variable dynamically" or something to reiterate
that this sentence is only about dynamic binding. Without that, the reader
could take it to be independent of which mode is currently selected.
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
next prev parent reply other threads:[~2023-12-04 3:08 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 5:54 bug#66756: 30.0.50; [PATCH] Improve discussion of 'let' in Elisp Introduction manual Jim Porter
2023-10-26 18:30 ` Jim Porter
2023-10-29 16:38 ` Richard Stallman
2023-10-29 17:18 ` Drew Adams
2023-11-18 2:09 ` Jim Porter
2023-11-19 3:39 ` Richard Stallman
2023-11-19 5:25 ` Jim Porter
2023-11-19 5:30 ` Jim Porter
2023-11-19 8:38 ` Michael Albinus
2023-11-19 20:17 ` Jim Porter
2023-11-19 23:05 ` Jim Porter
2023-11-20 13:28 ` Michael Albinus
2023-11-23 2:57 ` Richard Stallman
2023-11-23 21:04 ` Jim Porter
2023-11-24 7:06 ` Eli Zaretskii
2023-11-24 9:01 ` Jim Porter
2023-11-24 11:41 ` Eli Zaretskii
2023-11-24 21:46 ` Jim Porter
2023-11-25 7:51 ` Eli Zaretskii
2023-11-30 21:03 ` Jim Porter
2023-12-01 8:29 ` Eli Zaretskii
2023-12-04 3:08 ` Richard Stallman
2023-12-04 3:08 ` Richard Stallman [this message]
2023-12-04 4:34 ` Jim Porter
2023-12-10 19:36 ` Jim Porter
2023-12-16 23:10 ` Stefan Kangas
2023-12-17 20:47 ` Jim Porter
2024-01-09 18:40 ` Jim Porter
2023-12-04 3:08 ` Richard Stallman
2023-11-04 8:27 ` Eli Zaretskii
2023-11-04 16:44 ` Jim Porter
2023-11-06 2:29 ` Richard Stallman
2023-11-06 2:29 ` Richard Stallman
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=E1r9zK1-0003MB-PT@fencepost.gnu.org \
--to=rms@gnu.org \
--cc=66756@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=jporterbugs@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.