unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27
@ 2022-11-21 21:19 Adam Porter
  2022-11-21 21:33 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Porter @ 2022-11-21 21:19 UTC (permalink / raw)
  To: emacs-devel

Hi,

I recently received a bug report to one of my Elisp packages to replace 
the use of a (setf (point) ...) form with (goto-char ...) because the 
generalized setter has been marked as obsolete in Emacs 29.  Digging 
into emacs.git, I found that this was done in August in commit 
48aacbf292fbe8d4be7761f83bf87de93497df27.

The rationale given by Lars was twofold:

- The vast majority of these are unused in-tree,
- many of them perform actions that aren't obvious when reading the
   code.

The latter seems like a good reason to obsolete some forms.  But the 
former doesn't seem like a good reason to remove working code.  AFAIK, a 
simple (setf (point) ...) form, for example, doesn't cause any problems 
or have any unexpected side effects.

I discovered the ability to use forms like (point) as generalized 
variables relatively recently, and I've enjoyed using it in my code, as 
it follows a convenient, more concise pattern in many cases.  I'd 
generally (ha) like to see more generalized variables and setters in 
Elisp, not less.  The fact that many such forms have gone unused for a 
while in-tree is likely due to few people being aware that they can be 
used, as well as the existence of (setf ...) itself being relatively 
unknown among Elispers.  I don't think it means that no one wants to use 
them, or that no one would do so in the future.

So I'd like to ask that this commit, or at least some parts of it, be 
reverted--that the setters that present no traps for the unwary 
programmer be restored to fully accepted status.

At the least, it would seem like a good idea to have an open discussion 
before removing 38 such setters from Elisp.  If these kinds of setters 
are to be disallowed, it seems like that ought to be a known policy with 
a stated justification rather than an unwritten rule.

(Please cc me on replies.)

Thanks,
Adam



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-22  1:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-21 21:19 Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27 Adam Porter
2022-11-21 21:33 ` Stefan Monnier
2022-11-21 22:11   ` Adam Porter
2022-11-22  0:02     ` Ihor Radchenko
2022-11-22  1:56     ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).