[squeak-dev] Ideas about sets and dictionaries
Igor Stasenko
siguctua at gmail.com
Wed Nov 11 21:56:20 UTC 2009
2009/11/11 Russell N Hyer <hrothgar.ofstingan at gmail.com>:
> 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!
>
No no. This is cheating. Nobody is interested in the ways how object
manages its internal state. The most interesting is
how good its public interface.
The right test to check if set contains nil is to send:
badger includes: nil.
and what Levente proposing is obviously that such test should return
true, if you send
badger add: nil
before.
> 2009/11/11, Levente Uzonyi <leves at elte.hu>:
>> Hi!
>>
>> On Wed, 11 Nov 2009, Russell N Hyer wrote:
>>
>>> So you're really talking about having two types of null?
>>>
>> No. I'm talking about letting a set contain nil. Try evaluating Set with:
>> nil. and you will see what my problem is.
>>
>>> nil being the set that contains nothing
>>>
>> nil is not a set. Set new gives you an empty set.
>>
>> Cheers,
>> Levente
>>
>>
>
>
--
Best regards,
Igor Stasenko AKA sig.
More information about the Squeak-dev
mailing list
|