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

Tobias Pape Tobias_Pape at gmx.de
Thu Nov 12 13:42:28 UTC 2009


Hello —,
Am 2009-11-12 um 12:11 schrieb Igor Stasenko:

> a SetElement class then is a one-inst-var object, holding a reference
> to proxied object, and
> needs to properly implement #hash #= , required by Set.
> Also, at each place where we need to feed a real object , a Set should
> send an #unwrap (or give more distinct selector name)
> to return enclosed object.

probaly, the folowing would also be possible:

for all, except the “special” object,

#asSetElement

	^ self

the other two shall return an actual wrapper.

this shall retrun the actual entry upon called #value:

#value

	^ wrappedEntry

Then, to obtain an entry , it would be called
asking for its #value.

Problem then: Blocks :)

so long,
	-Tobias




More information about the Squeak-dev mailing list