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

Andreas Raab andreas.raab at gmx.de
Thu Nov 12 05:48:43 UTC 2009


Igor Stasenko wrote:
> A simple illustration:
> 
>  set := Set new.
>  Object allInstancesDo: [:obj | set add: obj ]   "using 'Object new'
> as filler, right?"
> 
> we could argue very long why one would want to do that, but the fact
> is clear: your proposal have nothing
> to offer to developer how to get around that.

Don't use Object then. Use instances of EmptySetMarkers. That way you 
know that when adding instances of EmptySetMarkers to sets that have 
been previously created will cause problems. And if you want to 
enumerate those in a Set use a different marker explicitly, i.e.,

set := Set withMarker: MyPrivateSetMarkerThatIsUsedNowWhereElse.
EmptySetMarker allInstancesDo:[:obj | set add: obj].

(seriously, Igor, this is not a good line of argumentation, the problems 
you are describing simply do not exist in practice)

Cheers,
   - Andreas




More information about the Squeak-dev mailing list