GNU bug report logs -
#66756
30.0.50; [PATCH] Improve discussion of 'let' in Elisp Introduction manual
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Thu, 26 Oct 2023 05:56:01 UTC
Severity: normal
Tags: patch
Found in version 30.0.50
Fixed in version 29.2
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #53 received at 66756 <at> debbugs.gnu.org (full text, mbox):
[[[ 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. ]]]
Your work is good.
After this,
> +;;; -*- lexical-binding: t -*-
> +
> +(setq x 1)
> +
> +(defun getx ()
> + x)
> +
> +(let ((x 2))
> + (getx))
> + @result{} 1
> +@end example
it could be good to add the following:
+(setq x 3)
+
+(let ((x 2))
+ (getx))
+ @result{} 3
+
+(setq x '(foo))
+
+(let ((x 2))
+ (getx))
+ @result{} (foo)
+@end example
to show that `getx' accesses the current value of the global binding,
not the value that the global binding had when getx was defined.
Adding this to the lexical binding example
+(setq x 3)
+
+(let ((x 2))
+ (getx))
+ @result{} 2
+
+(setq x '(foo))
+
+(let ((x 2))
+ (getx))
+ @result{} 2
could also help, by showing that changes in the global binding's value
are irrelevant for references to x where that binding is shadowed.
Or perhaps this pair of examples should be presented as a separate
point following the other one.
--
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)
This bug report was last modified 1 year and 229 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.