[squeak-dev] Re: Sets with nil (Was: Ideas about sets and
dictionaries)
radoslav hodnicak
rh at 4096.sk
Thu Nov 12 13:34:48 UTC 2009
ok, I've probably picked up this habit in VisualWorks, and patched all my
Squeak images to do nothing instead of raising an error in #add: if the
parameter is nil
rado
On Thu, 12 Nov 2009, Levente Uzonyi wrote:
> 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
|