* 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
* Re: Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27
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
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2022-11-21 21:33 UTC (permalink / raw)
To: Adam Porter; +Cc: emacs-devel
> At the least, it would seem like a good idea to have an open discussion
> before removing 38 such setters from Elisp.
They were not removed: they were obsoleted.
When we mark a feature obsolete, it *is* a (last) call for discussion
before we remove it.
So go ahead, and argue away to defend those generalized vars you think
we should keep. Make those arguments concrete, tho: those 38 generalized
vars are pretty much all independent from each other, so each one should
be debated on its own merits.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27
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
0 siblings, 2 replies; 5+ messages in thread
From: Adam Porter @ 2022-11-21 22:11 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Hi Stefan,
On 11/21/22 15:33, Stefan Monnier wrote:
>> At the least, it would seem like a good idea to have an open discussion
>> before removing 38 such setters from Elisp.
>
> They were not removed: they were obsoleted.
> When we mark a feature obsolete, it *is* a (last) call for discussion
> before we remove it.
Ah, I misunderstood: I thought marking something as obsolete meant that
the decision has been made, and users should begin removing it from
their code.
> So go ahead, and argue away to defend those generalized vars you think
> we should keep. Make those arguments concrete, tho: those 38 generalized
> vars are pretty much all independent from each other, so each one should
> be debated on its own merits.
I agree that each should be debated on its own merits. But has the
burden been reversed? Could we argue why they should be removed rather
than why they should be kept? I would generally argue that features
that have been implemented should be considered useful (otherwise, why
would they have been added?) and not be removed except for specific
reasons.
And I don't know who has the time to research and argue to undo 38
individual things that I wish hadn't been done all-at-once in the first
place. :)
Thanks,
Adam
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27
2022-11-21 22:11 ` Adam Porter
@ 2022-11-22 0:02 ` Ihor Radchenko
2022-11-22 1:56 ` Stefan Kangas
1 sibling, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2022-11-22 0:02 UTC (permalink / raw)
To: Adam Porter; +Cc: Stefan Monnier, emacs-devel
Adam Porter <adam@alphapapa.net> writes:
> I agree that each should be debated on its own merits. But has the
> burden been reversed? Could we argue why they should be removed rather
> than why they should be kept? I would generally argue that features
> that have been implemented should be considered useful (otherwise, why
> would they have been added?) and not be removed except for specific
> reasons.
One reference is https://yhetil.org/emacs-devel/877d2w1ua0.fsf@tcd.ie
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Obsoleting of generalized variable setters in 48aacbf292fbe8d4be7761f83bf87de93497df27
2022-11-21 22:11 ` Adam Porter
2022-11-22 0:02 ` Ihor Radchenko
@ 2022-11-22 1:56 ` Stefan Kangas
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2022-11-22 1:56 UTC (permalink / raw)
To: Adam Porter, Stefan Monnier; +Cc: emacs-devel
Adam Porter <adam@alphapapa.net> writes:
> I agree that each should be debated on its own merits. But has the
> burden been reversed? Could we argue why they should be removed rather
> than why they should be kept?
Lars did make the argument at the time that they had surprising and
hard-to-understand semantics. So I think that general principle is one
that we already try to follow.
> And I don't know who has the time to research and argue to undo 38
> individual things that I wish hadn't been done all-at-once in the first
> place. :)
I'd suggest reporting bugs to unobsolete only the ones you care about.
The ones you don't care about are probably okay to obsolete, right? And
if they are not, others will report bugs.
^ 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).