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

Sean Whitton <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
Björn Lindqvist [13/Aug  3:47pm +02] wrote:
> 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.

I think we'd really like to see examples.  I don't think I have ever
done it so I have a hard time believing "extremely".

> 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.

Looks like Python has it.  Perl doesn't.

-- 
Sean Whitton
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.