[squeak-dev] Set = IdentitySet ?

Frank Shearar frank.shearar at gmail.com
Mon Oct 7 14:34:05 UTC 2013


On 7 October 2013 12:30, Stéphane Rollandin <lecteur at zogotounga.net> wrote:
> Hello,
>
> I just noticed that in my working image (4.4),
>
> (Set with: #a) = (IdentitySet with: #a)
>
> is true. Is that a feature ?

I guess it would depend on who you ask! #= answers the question "are
these two objects equivalent?" Since they both represent a set with
the same single element (specifically, an element whose #= == #==
(sorry, I couldn't resist that)), yes, they are equivalent. Feature!

But on the flip side {#a} = (OrderedCollection with: #a) => false
(because their #species differ).

frank


More information about the Squeak-dev mailing list