GNU bug report logs - #66706
[PATCH] Automatic elisp dialect insertion

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Date: Mon, 23 Oct 2023 17:48:01 UTC

Severity: wishlist

Tags: patch

Full log


View this message in rfc822 format

From: Jim Porter <jporterbugs <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 66706 <at> debbugs.gnu.org, mattias.engdegard <at> gmail.com, Po Lu <luangruo <at> yahoo.com>, Dmitry Gutov <dmitry <at> gutov.dev>, stefankangas <at> gmail.com, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#66706: [PATCH] Automatic elisp dialect insertion
Date: Wed, 25 Oct 2023 18:19:20 -0700
On 10/25/2023 5:51 PM, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
>> 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.)
> 
> Nothing is "missing" but the above describes dynamic binding, static
> binding has a different behavior which is not like "a setq at the
> beginning which is undone at the end".  So this paragraph needs to be
> fully rewritten.

This is helpful. The bit about 'setq' seemed a bit roundabout (to say 
the least), and while I can see how it might help explain 'let' to a 
novice, it's probably more likely to mislead them instead.

I'll start with a patch here then. I think this is also a prime spot to 
add an example or two that would actually show lexical binding in action 
(i.e. a sample where the code would do something different under dynamic 
binding).

- Jim




This bug report was last modified 1 year and 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.