GNU bug report logs - #47992
27; 28; Phase out use of `equal` in `add-hook`, `remove-hook`

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sat, 24 Apr 2021 12:12:01 UTC

Severity: normal

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Daniel Mendler <mail <at> daniel-mendler.de>, "jakanakaevangeli <at> chiru.no" <jakanakaevangeli <at> chiru.no>, "monnier <at> iro.umontreal.ca" <monnier <at> iro.umontreal.ca>, "47992 <at> debbugs.gnu.org" <47992 <at> debbugs.gnu.org>
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
Drew Adams <drew.adams <at> 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




This bug report was last modified 3 years and 323 days ago.

Previous Next


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