Guile Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme style auto-resizing hashtable
russell.mcmanus@gs.com writes:
> Maciej Stachowiak <mstachow@mit.edu> writes:
>
> > Another note: I use both eq? and equal? hashing in my code a fair
> > bit. It would be nice if your code were able to hash by any of
> > eq?, eqv? or equal? (the hashers for the first two should not be
> > hard).
>
> Why not an arbitrary equality test?
That would be nice too, but you really need a hash function that
hashes pairs of objects that satisfy the equivalence predicate to the
same value, and does its best to avoid collisions otherwise. It might
be hard for users to come up with one (though probably not
impossible).
As an example, suppose I had a set-equal? which tests if two lists
have equal? elements but possibly in different order. Since this
equivalence predicate is even broader than eqaul?, using the equal?
hasher would not give correct semantics (set-equal? keys might not
hash to the same thing).
- Maciej
Guile Home |
Main Index |
Thread Index