[squeak-dev] Re: Sets with nil (Was: Ideas about sets and dictionaries)

Igor Stasenko siguctua at gmail.com
Thu Nov 12 12:02:30 UTC 2009


2009/11/12 Bert Freudenberg <bert at freudenbergs.de>:
>
> On 12.11.2009, at 12:49, 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.
>
> (Array new: 5) asSet
>
> raises an error in Squeak ...
>
>> Now, I obvioulsy do not see the value of allowing Sets to contain nil, but other people do. How about creating a new class to handle this? NilSet or whatever
>>
>> rado
>
> Not a bad suggestion. SetWithNil?
>
yeah, except that if following that road, i would first make a base
class, which allows nils, and only then a subclass which doesn't,
because IMO, a set which doesn't allows nils is specialized version of
more generic which does.

> - Bert -
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list