Re: [PATCH] Implement `equal' for hash tables

Björn Lindqvist <[email protected]> Thu, 13 Aug 2026 15:47:46 +0200
Newsgroups gmane.emacs.devel
Message-ID <CALG+76ft_V73GRj_jnyhiBtd5+BviygZe3GftFWWNoAqHm4E-w@mail.gmail.com>
Den ons 5 aug. 2026 kl 11:36 skrev Sean Whitton <[email protected]>:
>
> Nick Alcock [04/Aug  9:16pm +01] wrote:
> > Hash tables are equal if they have equal atoms, weakness, and equality
> > and hash functions.
> >
> > (This also means that equal of structures which contain hash tables is
> > useful now, too, which is really the reason I implemented this: right
> > now, hash tables are a sort of poison pill which render any object into
> > which they are inserted unequal with all others.  No more.)
>
> Is it useful in a programming language for hash table objects to be
> directly comparable like this?  I'm not sure that it is.

Yes, it is extremely useful. To the best of my knowledge, there is not
a single programming language which distinguishes between equality and
identity created since Java that does not support comparing hash
tables for equality. And the doc for equal says "Return t if two Lisp
objects have similar structure and contents" which suggests that
equality should work structurally for hash tables (as it does for most
other container types).


-- 
mvh/best regards Björn Lindqvist