es-discuss Digest, Vol 41, Issue 9

P T Withington ptw at
Tue Jul 6 05:55:43 PDT 2010

On 2010-07-04, at 04:09, Brendan Eich wrote:

> Likewise for hashcode: if the object's address is one-way hashed to the hashcode() result, but the GC moves the object, then the object will need to grow a field to store its invariant hashcode.

FWIW Dylan (and its ancestors) gets around this by having object-hash return 2 values:  a hash code and a hash state.  You can only compare hash codes associated with the 'same' state. The hash state is an opaque object with operations for comparing and accumulating (e.g., to compute the hash state of a table of objects).

More information about the es-discuss mailing list