[R6RS] symbol-hash

William D Clinger will at ccs.neu.edu
Fri Aug 11 12:27:55 EDT 2006

Kent wrote:
> I'm guessing that symbol-hash is intended to be used to build hash
> functions for aggregate objects that may contain symbols,

It's not just aggregate objects.

In surveying large bodies of Scheme code, I have
found that finite mappings from symbols to other
values are quite common, so hash tables whose
keys consist entirely of symbols will be common.

> and that the
> rationale for providing it is that an implementation may already cache
> some sort of hash value for symbols.  Right?

Yes, where "may already" really means "may already
do so or may want to do so in the future".

> Should we say this explicitly in the document

A rationale would be appropriate, but isn't essential.

> and also that eq hash tables suffice when only
> symbols are involved?

Yes, you could say that.  I think it's more important
to warn that eq? hash tables could be substantially
more expensive than ordinary hash tables that compare
using equal? and hash using object-hash.


More information about the R6RS mailing list