Email list hosting service & mailing list manager

Hash functions of the {eq,eqv,equal}-comparators Daphne Preston-Kendal (16 Jul 2021 16:20 UTC)
Re: Hash functions of the {eq,eqv,equal}-comparators Marc Nieper-Wißkirchen (16 Jul 2021 17:17 UTC)
Re: Hash functions of the {eq,eqv,equal}-comparators Daphne Preston-Kendal (16 Jul 2021 19:46 UTC)
Re: Hash functions of the {eq,eqv,equal}-comparators Marc Nieper-Wißkirchen (16 Jul 2021 20:21 UTC)
Re: Hash functions of the {eq,eqv,equal}-comparators Marc Nieper-Wißkirchen (16 Jul 2021 20:34 UTC)
Re: Hash functions of the {eq,eqv,equal}-comparators Arthur A. Gleckler (02 Oct 2021 19:09 UTC)
Re: Hash functions of the {eq,eqv,equal}-comparators Arthur A. Gleckler (27 Mar 2022 23:34 UTC)
Re: Hash functions of the {eq,eqv,equal}-comparators Marc Nieper-Wißkirchen (19 Apr 2022 07:11 UTC)
Re: Hash functions of the {eq,eqv,equal}-comparators John Cowan (28 Apr 2022 13:37 UTC)
Re: Hash functions of the {eq,eqv,equal}-comparators Marc Nieper-Wißkirchen (28 Apr 2022 14:08 UTC)

Hash functions of the {eq,eqv,equal}-comparators Daphne Preston-Kendal 16 Jul 2021 16:20 UTC

SRFI 128 specifies of all three of the eq-, eqv-, and equal-comparators that they all use the default-hash procedure as their hash function. This means the eq-comparator can be no more discerning at the hash stage than the equal-comparator, even though many implementations should be able to provide a 'real' eq-comparator hash function that just converts the (tagged) pointer of whatever it’s called on into an exact Scheme integer. This has the bizarre result that hashing something with the eq- and eqv-comparators is required by the spec to have worse performance than actually doing a comparison with the eq? or eqv? procedures, since eq? and eqv? will never recurse into list structures or compare symbols and strings character-by-character.

While *allowing* those comparators to all have the same hash function allows SRFI 128 to be portable to R7RS small, it seems a mistake to *require* it.

I hope this can be fixed with a post-finalization note relaxing the requirement for all three to use default-hash to merely *permitting* all three to use default-hash; otherwise I'd be happy to give up my reservation on the SRFI number 228 for a do-over of this SRFI incorporating this change, plus maybe SRFI 162, and the procedures I had in mind for that stand-alone SRFI anyway.

Daphne