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

Andreas Raab andreas.raab at gmx.de
Thu Nov 12 08:42:53 UTC 2009


Levente Uzonyi wrote:
> But we now have a lot more proposals, let me summarize them all:
> 
> - (1)add a new instance variable: containsNil
> - (2)use tally to indicate if nil is in the set
>  - (a)negative values mean nil is contained by the set
>  - (b)floats - (3)use a marker object
>  - (a)self
>  - (b)a unique object in each set
>  - (c)a class variable
> - (4)use container objects in occupied slots, like associations in 
> dictionaries
> 
> I prefer 3c, 2a, 3a, 1, 4 in the given order.
> What about you?

Nice summary. My current preferences would be (1) (clear and obvious) 
(3b) (ditto) and (3a)/(3c) (both with some hesitation). I'm not sure 
about (4) (I've only just heard of it; it sounds cool but I haven't seen 
no code yet). I would veto both (2a) and (2b) as obscure hacks compared 
to (1) unless the size overhead is significant.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list