identityHash patch discussion.

Scott A Crosby crosby at qwes.math.cmu.edu
Mon Dec 10 22:51:40 UTC 2001


On Mon, 10 Dec 2001, Stephen Pair wrote:

> Why not just add a method like largeHash, and implement "large" variants
> of the existing hashed structures (i.e. LargeSet).  Then you'd only use
> the large variant for the collections that you anticipate will grow very
> large.  That would seem to eliminate the problem of getting it into the
> image.

Why bother? The patch is basically trivial, and extends uniformly to all
sizes of collections with no edge or error cases. Also, once you do get it
in, you can proceed to refactor and simplify collections. (Now, all the
scansFor: methods are basically identical. factor out a new function
'hashobject:', and override that to invoke '^object identityHash',
'^object hash', or 'hashfunc value: object'.)

IMHO, it is not good to add 'yet another special collection' especially if
we don't have to.

Scott







More information about the Squeak-dev mailing list