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

Tobias Pape Das.Linux at gmx.de
Thu Nov 12 06:40:13 UTC 2009


Hello —,
Am 2009-11-12 um 06:35 schrieb Andreas Raab:

> Igor Stasenko wrote:
>> 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.
> 
> Absolutely not. The main purpose of having nil be included in sets is to remove a particular restriction (namely that Sets cannot contain nil), not to "be able to hold _any_ potentially existing objects in an image". What is being proposed is trading one restriction (Sets cannot contain nil) against another one (Sets cannot contain their internal private marker) which is deemed advantageous as it allows us to convert many collections that contain nil into sets without blowing up. *That* is the main purpose.
> 
> The goal of "be able to hold _any_ potentially existing objects in an image" is neither achievable nor worthwhile. Try this for starters:
> 
>  (s := Set new) add: s; add: s.

As far as I know, another approach is to have
Distinct Entry Object inside the set. cf. the GemStone
approach.  A set, there, contains an ordered collection of 
nils an Entry elements. Thus, the actual element is stored _inside_
the entry element, not in the underlying (storage) collection
of the array itself.  As far as I know, this is similar to its Dictionary
approach.
   Probably, this will introduce a slightly broader spectrum of
optimization possibilities.

So long,
	-Tobias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: Signierter Teil der Nachricht
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20091112/ad9c29df/PGP.pgp


More information about the Squeak-dev mailing list