[squeak-dev] SequenceableCollection #= method in current trunk differs from Squeak 5.2
Levente Uzonyi
leves at caesar.elte.hu
Wed Jul 1 00:55:10 UTC 2020
On Tue, 30 Jun 2020, Chris Muller wrote:
> Might be worth reopening this discussion. ANY dependencies on #class seem like a bad thing to me, especially while it's still an in-lined message. Below is the MC version that did it. Looks like the time to change this
Using #class by default sounds correct to me. If some instances of
classes want to be equal to each other, they should handle that
themselves by overriding #=.
Using #species everywhere is just horrible.
> 19-year old core method went from "itch" to trunk in all but just a few hours...
How did you come to that conclusion?
Levente
> ________________
> Name: Collections-nice.820
> Author: nice
> Time: 12 February 2019, 11:56:35.262017 pm
> UUID: bb383133-067c-4133-987b-c481a7de69c7
> Ancestors: Collections-ul.819, Collections-cbc.813
>
> Definitively abandon SequenceableCollection equality tests based on equal species.
>
> Old behaviour can still be obtained thru hasEqualElements: but the default is to not try to support such trans-class equality feature because it is much too complex.
>
> Particularly Interval are no more equal to Arrays with same sequence. We can thus optimize hash a bit more and fix the old bugs of equa objects with different hashes. Merge Collections-cbc.813 for this and rehashAll in
> postscript.
>
> There are not so many classes concerned by this change, mainly RunArray, Interval and LinkedList:
>
> Collection withAllSubclasses select: [:e | [e basicNew species ~= e] on: Error do: [false]]
> -> an OrderedCollection(WeakRegistry LinkedList Interval ByteCharacterSet CharacterSetComplement LazyCharacterSet WideCharacterSet ShortRunArray Semaphore Mutex TextLineInterval WeakArray Monitor MCVersionName ByteSymbol
> WideSymbol)
>
> We will have to change the tests that rely on such equality.
>
> On Mon, Jun 29, 2020 at 3:42 AM Nikolay Suslov <nsuslovi at gmail.com> wrote:
> Thanks Levente,
>
> Yes, seems to be RFB/VNC from the SqueakSource-SqF project page is outdated (at least it is working in Squeak 5.2 and not in 5.3 and later). Your version works fine!
> However, it is interesting what was the reason for that change just in SequenceableCollection #=. As Set, Bitset, SortedCollection etc. classes still use species comparison in #= (checking they have the same set of
> keys)?
>
> Best regards,
> Nikolai
>
> On Mon, Jun 29, 2020 at 3:43 AM Levente Uzonyi <leves at caesar.elte.hu> wrote:
> Hi Nikolai,
>
> On Mon, 29 Jun 2020, Nikolay Suslov wrote:
>
> > Hello all,
> > Figuring out, could we go back to the previous version of SequenceableCollection #= method (as in Squeak 5.2), to check if the receiver is equivalent to the otherCollection by using "self species ==
> otherCollection species",
> > instead of "self class = otherCollection class"?
>
> IIRC there was a good reason for that change though I can't recall
> what it was. I'm sure the mailing list remembers.
>
>
> > The current version of #= method breaks code in different places. For example the RFB/VNC server gives wrong results starting from an authentication process, where RFBMessage is the ByteArray subclass and
> implements #species.
>
> If you're looking for a fix, try this:
> http://leves.web.elte.hu/squeak/RFB-ul.18.mcz
>
>
> Levente
>
> >
> > Best regards,
> > Nikolai
> >
> >
>
>
>
>
More information about the Squeak-dev
mailing list
|