On Nov 26, 2008, at 4:07 PM, leppie wrote:

You can use string-hash, you could perhaps write to a string.

You mean:

(define (equal-hash x)
  (string-hash (with-output-to-string (lambda () (write x)))))

Sure, if that's what *you* want, then you can define equal-hash
that way and pass it to make-hashtable.  But then you know where
your run time is spent and who to blame for it (i.e., not me).

Will be tremendously slow though ...

And very funny too for anybody reading my source code. :-)

Yes, it is very slow and you'd be better off using assoc and not
bothering with hash tables once your hash function becomes this
expensive.

I wonder why eq-hash is not required/allowed by the R6RS?

Allowed?  Of course you're allowed to do whatever you want.
Required?  Why?  You can implement it as a portable library
if you really need it.

Aziz,,,

Reply via email to