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


Message #56 received at 47992 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Daniel Mendler <mail <at> daniel-mendler.de>,
 "jakanakaevangeli <at> chiru.no" <jakanakaevangeli <at> chiru.no>,
 "47992 <at> debbugs.gnu.org" <47992 <at> debbugs.gnu.org>
Subject: Re: [External] : bug#47992: 27; 28; Phase out use of `equal` in
 `add-hook`, `remove-hook`
Date: Sun, 25 Apr 2021 09:52:45 -0400
> Read what I said about _real_ functions, which is whose
> equality is undecidable.

`add/remove-hook` sadly lives in the real world.

> As contrasted with the equality of Lisp "functions", represented as
> symbols, strings, or lambda forms.

Strings aren't used to represent functions in Lisp, and the case of
lambda-forms is the case that's actually causing real performance
problems in add/remove-hook (both interpreted and compiled).

So, yes, symbols is the only option remaining, to enforce the `eq`
semantics which seems to be at least as often what we want and doesn't
suffer from performance problems.

> The latter is certainly decidable, and it's what we use in
> `remove-hook' to decide.

My comment about decidability was just a side remark that doesn't really
matter for this decision.  I now regret mentioning it.


        Stefan





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.