Subject: Re: [External] : bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook`

From: Daniel Mendler <[email-masked]>
Date: Sun, 25 Apr 2021 00:38:25 +0200

On 4/25/21 12:30 AM, Stefan Monnier wrote:
>> Perhaps `equal' can be fixed to do something better with closures?
> 
> There's no magic: `equal` has to check the structural equality, so it
> has to recurse through the whole structure, including all the
> closed-over variables to which it refers.

Well, structural equality on closures is an arbitrary choice. One could 
simply refuse to compare closures structurally and treat them as opaque 
objects. The structural equality does not even perform alpha conversion. 
This is probably due to how binding works in Elisp?

(equal (lambda (x) x) (lambda (y) y))

Daniel