Subject: Re: bug#68668: 30.0.50; Invalid hash table test: tab-bar--auto-width-hash-test

From: Gerd Möllmann <[email-masked]>
Date: Wed, 31 Jan 2024 14:34:52 +0100

Mattias Engdegård <[email-masked]> writes:

> 31 jan. 2024 kl. 14.05 skrev Gerd Möllmann <[email-masked]>:
>
>> why not reuse an existing entry for a given name?
>
> We mustn't violate invariants of existing hash-table objects when the
> test is redefined. Consider:
>
> (define-hash-table-test 'mytest #'cmp1 #'hash1)
> (setq h (make-hash-table :test 'mytest))
> ...
> (define-hash-table-test 'mytest #'cmp2 #'hash2)
> ; h must still use cmp1 and hash1 at this point

But that also means that we end up with two sorts of hash-tables that
behave differently, without us being able to tell them apart, because
hash-table-test returns 'mytest for both. I think I'd prefer if that
were not the case, and the redefinition would apply to both. If an old
hash-table then behaves stragely, I know what's up, and can empty it, if
it isn't still empty in the first place.

Just my 2 cents.