[squeak-dev] Re: Ideas about sets and dictionaries

Igor Stasenko siguctua at gmail.com
Thu Nov 12 03:27:53 UTC 2009


2009/11/12 Randal L. Schwartz <merlyn at stonehenge.com>:
>>>>>> "Andreas" == Andreas Raab <andreas.raab at gmx.de> writes:
>
> Andreas> Seriously, how *would* you address this problem if you weren't trying to make
> Andreas> it fit exactly?
>
> I like the proposal that each set have an additional instance var that gets an
> "Object new" stuffed in it to indicate what "nil" does today, for that
> *particular* set.  That seems relatively cost effective *and* space effective.
> Every "isNil" for "this slot is empty" just becomes "== myEmptyVal".
>

Sorry, didn't commented earlier.
Such proposal make little difference comparing to currently existing
implementation,
 and i'd prefer to not having it, and leave things as they are, given
an additional costs which it implies.

The main purpose to be able to handle nils in sets as an elements is to make Set
be able to hold _any_ potentially existing objects in image.

But your solution could be described as:
a) we having a basket full of differently colored balls.
b) while counting balls in basket lets count all balls, except
transparent ones.
..and your idea:
rewrite b:  while counting balls in basket lets count all balls,
except red ones.



> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
> See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list