[squeak-dev] Re: Sets with nil (Was: Ideas about sets and
dictionaries)
Levente Uzonyi
leves at elte.hu
Thu Nov 12 12:01:20 UTC 2009
Hi!
On Thu, 12 Nov 2009, radoslav hodnicak wrote:
>
> In all my time I've been programming in Smalltalk (since about 2000), the
> idea that Sets simply do not contain nil was a core assumption of using
> collection classes for me, not just an implementation detail. I routinely do
> "something asSet" to get rid of nils, and this change would break all my
> code.
>
I doubt that. I get an Error when I'm evaluating this: #(1 nil 2) asSet
You should use #(1 nil 2) reject: [ :each | each isNil ] instead.
Cheers,
Levente
More information about the Squeak-dev
mailing list
|