[squeak-dev] Ideas about sets and dictionaries
Levente Uzonyi
leves at elte.hu
Wed Nov 11 21:55:52 UTC 2009
Hi!
On Wed, 11 Nov 2009, Russell N Hyer wrote:
> Sets already contain nil,
>
> Evaluate this, for example:
>
> | badger |
>
> badger := Set new.
> badger add: 1.
> badger inspect
>
> and you'll see there are already nils!
Not exactly. Just because you see nils in the inspector it doesn't mean
the set contains it. Try this: Set new add: 1; includes: nil.
Nils in the inspector only mean that empty slots in array are
marked with nil. You may find the class comment of Set helpful.
Cheers,
Levente
More information about the Squeak-dev
mailing list
|