HashBits, a lazy way
Ned Konz
ned at bike-nomad.com
Fri Jul 11 17:57:52 UTC 2003
On Friday 11 July 2003 10:32 am, Bob Arning wrote:
> On Fri, 11 Jul 2003 10:13:02 -0700 Tim Rowledge
<tim at sumeru.stanford.edu> wrote:
> >I would point out that I was rather surprised to see a large
> > number of Objects in the Symbol class var 'SymbolTable'. Surely
> > just Symbols ought to be in there? Is this some sideffect of
> > WeakArray?
>
> That Object is the <flag> used by WeakSet to mark empty spaces. I
> was a bit surprised to see nils as well. Hmm...
WeakSet is a bit schizoid about nils vs. flag.
If you try to #add: a nil, you get an error (sets can't meaningfully
contain nil). If you proceed through this error, #includes: will find
the nil.
But #do: skips nils, and #growTo: discards them. And #add: will write
over them.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|