emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master b72f885: Make dlet work like let, not let*


From: Mattias Engdegård
Subject: Re: master b72f885: Make dlet work like let, not let*
Date: Tue, 3 Aug 2021 17:21:14 +0200

3 aug. 2021 kl. 15.33 skrev Eli Zaretskii <eliz@gnu.org>:

> People out there use Emacs 28 for a long time, so of course there is a
> compatibility problem, albeit a smaller one than if we have already
> had released Emacs with dlet.

Of course, but that's not really a compatibility promise but merely being nice, 
which we of course try to be but I'm quite sure that our esteemed Emacs 28 
users understand that we didn't give them an iron-clad guarantee.

The change itself is also low-risk: it's an esoteric function and I've found no 
use of it anywhere outside the Emacs tree -- I did search. Furthermore, even 
inside Emacs all uses were found to be insensitive to the let/let* binding 
semantics.

However you do raise a good point. For incompatible changes in official 
releases we have etc/NEWS, but nothing really like it for things that we just 
broke on master. Perhaps it would be useful to have a document tracking these 
things so that everyone doesn't have to read every git diff to understand what 
is going on? `etc/NEWS.development`, say?

> Could you please tell what were the reasons that led you to make this
> change?  Because I don't really understand the motivation.  Is it just
> the name that lacks the '*' part, or is it something else?

Well sort of: if someones finds out about a construct named `dlet`, it's just 
natural to assume that it binds like `let`, not like `let*`. (Supporting 
evidence: two local macros on the pattern `something-dlet*` were in use. One of 
the has now been renamed.)

There is also the possibility of someone finding it useful to have a version 
with `let`-like binding (which is a more fundamental operation, after all). 
What would such a macro be called? `dlet*` would be terrible.

Furthermore, the subtle difference in semantics can lead to even subtler bugs: 
a dependency that is overlooked may not actually cause trouble until much 
later. Consider

(dlet ((case-fold-search t)
       (my-dynamic-variable EXPR)
  ...something that requires both bindings above...)

If the programmer thought in `let` terms and didn't consider the effects of 
case-fold-search on EXPR, he wouldn't have thought to test it with input that 
would exercise such a dependency.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]