[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hash for eq?

This page is part of the web mail archives of SRFI 69 from before July 7th, 2015. The new archives for SRFI 69 contain all messages, not just those from before July 7th, 2015.

Panu Kalliokoski wrote:
On Tue, Aug 09, 2005 at 12:17:11AM -0700, Per Bothner wrote:

Should the reference implementation of make-hash-table be
modified so the default hash function for eq? is hash-by-identity?
I.e. add in the obvious place:

In the reference implementation, this does not help any, because it has
(define hash-by-identity hash).  If hash-by-identity were provided as a
primitive, then yes, it would make sense.  So it's just a question of
whether we can trust Scheme implementors that use the SRFI code
_partially_ to notice this particular thing.

I think it would clarify the intent better, both for users (it's useful
to look at the reference implementation to see an alternative and more
formal "specification"), and for implementors (often implementors take
a reference implementations and tweak places that the reference
implementation *recommends* shoudld be tweaked).  If you make the
change I suggested, it means a port has to modify less code (and
the diffs are better localized), and it also make it clear that an
implementation *should* use hash-by-identity (if provided) as the
default hash function for eq?.
	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/