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

Levente Uzonyi leves at elte.hu
Thu Nov 12 14:45:21 UTC 2009


On Thu, 12 Nov 2009, Jecel Assumpcao Jr wrote:

> Levente Uzonyi wrote:
>>> Which message send would you save in
>>>
>>> 	... == UnoccupiedSlot
>>>
>>
>> UnoccupiedSlot instance.
>> I wouldn't use a class, because I think we should be able create a set
>> with any classes in it.
>
> Indeed - I am sure there are several places in the image that deal with
> sets of all classes or all globals.
>
> One example of a Smalltalk with a non nil object to mark empty slots in
> sets is Self, so it has been done before. On the other hand, Self
> doesn't use associations but instead implements dictionaries with two
> parallel arrays.

I have an implementation with 2 arrays for Dictionary and also one with 
only one array with alternating keys and values which has the best cache 
locality, but both of them have slower access time than the current 
implementation and none of them can have nil keys. :)

Levente



More information about the Squeak-dev mailing list