[squeak-dev] set equality has changed :-(
Levente Uzonyi
leves at caesar.elte.hu
Tue Apr 19 00:18:36 UTC 2016
On Mon, 18 Apr 2016, Eliot Miranda wrote:
>
>
> On Mon, Apr 18, 2016 at 3:43 PM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> Hi Eliot,
>
> On Mon, 18 Apr 2016, Eliot Miranda wrote:
>
> Hi All,
> this used to work:
>
> (Set with: #module) = (IdentitySet with: #module)
>
> when did this change and why?
>
>
> I changed it in Collections-ul.669 last November, because it didn't work well. Let's see a different example:
>
> | s i |
> s := Set with: 'module' copy.
> i := IdentitySet with: 'module' copy.
> {
> s = i.
> i = s
> }
>
> The old implementation would return #(false true), while the new one evaluates to #(false false).
>
>
> Right. That's a pain, but fair enough. This is clumsy: (aSet size = 1 and: [aSet anyOne = #module]). This slightly less so: aSet = (aSet
> species with: #module).
You could also write it as
aSet asArray = #(module).
or as
(aSet as: Set) = (Set with: #module).
Levente
>
> Levente
>
> _,,,^..^,,,_
> best, Eliot
>
>
> _,,,^..^,,,_
> best, Eliot
>
>
More information about the Squeak-dev
mailing list
|