pTymN wrote:Turns out, Corman CL has a bug in sxhash where if you call (gc 2), you'll get different return values from sxhash. His hash table implementations had a hook that would trigger a rehash after a GC.
That's bad. There is nothing that prevents a programmer from using sxhash values for his own devices, not just in standard hashtables. If sxhash values can change in violation of the standard, you could get some bad bugs popping out. It was probably using the object's address as its hash value for some object types. Looking at the spec page for SXHASH, we see these requirements...
[
Looks like #2 and #3 are the operative requirements here. And it also looks like my idea of using the address as part of the calculation for symbols wouldn't work either, even in a system that stored the hash value with the symbol for later or had a non-moving GC. That is, #2 is a strong requirement that SXHASH values for symbols have to be the same even across Lisp images. If that's the case, it actually does suggest that FOO:BAR and FOO2:BAR might end up with the same SXHASH value unless you're also allowed to use the package as part of the hash calculation. I'm guessing that most implementations do.
Cheers, Dave
Slowly but surely the world is finding Lisp.
http://www.findinglisp.com/blog/