[squeak-dev] Re: Letting Set contain nils?

Klaus D. Witzel klaus.witzel at cobss.com
Sat Aug 9 13:07:26 UTC 2008


On Sat, 09 Aug 2008 14:41:42 +0200, Igor Stasenko wrote:

> 2008/8/9 Giovanni Corriga :
>> Igor Stasenko ha scritto:
>>>
>>> yes, i raised this topic exactly from this reason.
>>> What i'm not sure that is this change is so badly needed.
>>> Maybe its only me who get stuck with a problem how to deal with sets
>>> where nils are meaningful and useful value.
>>>
>>
>> Could it be that you're possibly missing an abstraction here? why not  
>> use a
>> different object, specialized for your needs, to represent your null  
>> value?
>>
>
> Because other part(s) of the system may not know about nulls as
> representation of nils, and in own turn may want to abstract a set
> containing nils - so it will use own null2 abstraction.. In result
> your end up operating with sets containing nulls and null2-s :)

If it where a Smalltalk system the two of you are talking about, the Set  
in question follows encapsulation principle, and nobody outside of Set  
would know how it memorizes unoccupied slots.

The implementor of Set is free to make own choice (all other things kept  
equal, like for example the contract with the VM on MethodDictionary while  
the latter inherits from Set).

/Klaus




More information about the Squeak-dev mailing list