eq and hashing (was Re: [plt-scheme] How to make unit functors?)
Robby Findler wrote:
>But, if you take the hash-code of one of them and then wait a while
>(and perform some garbage collections) then take the hash-code of the
>other, you'll find that they are different.
>
I have understood the hash-code will remain the same as long as the symbol
(that specific) is alive.
Experiments in the REPL supports this (but is of course not conclusie).
Try
(define s 's) ; so the symbol is kept alive
(eq-hash-code s)
(collect-garbage)
(eq-hash-code s)
(collect-garbage)
(eq-hash-code s)
(collect-garbage)
(eq-hash-code s)
--
Jens Axel Søgaard