bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#47992: [External] : bug#47992: 27; 28; Phase out use of `equal` in `


From: Lars Ingebrigtsen
Subject: bug#47992: [External] : bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook`
Date: Mon, 05 Jul 2021 14:39:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Drew Adams <drew.adams@oracle.com> writes:

> FWIW, I disagree.  There's no real need for such
> a "new form".
>
> I think the use case you've imagined for it is a
> s t r e t c h .  Users will just as likely avoid
> making any of your new forms as they avoid named
> functions now.

Languages that have added naming to their lambdas mostly do so because
it eases debugging and the like.  We're going to see more and more code
in Emacs that's based on closures, which means that our backtraces will
just contain a bunch of unnamed lambda forms, called from asynchronous
contexts, with no easy way for xref to jump to the location(s) where
they were defined, and profiling will have the same problem.

It's true that users will commonly avoid naming their lambdas, but
library makers (in Javascript, which has named lambdas) often do put
them in -- to aid debugging and profiling.

My suggestion, though, for the particular usage in hooks we were
discussing here, was that the new `push-hook' (or whatever) function
would disallow using anonymous lambdas, thereby forcing users to name
their lambdas (in this context).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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