Hello David,
On Fri, Jul 3, 2020 at 3:43 PM David T. Lewis lewis@mail.msen.com wrote:
On Mon, Jun 29, 2020 at 02:43:26AM +0200, Levente Uzonyi 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 change has my initials on it, and it was introduced here:
Name: Collections-dtl.821 Author: dtl Time: 16 February 2019, 6:18:27.925895 pm UUID: 9bfa29b3-5e9f-4c61-b19b-e0bb05403589 Ancestors: Collections-nice.820
Classes are expected to be unique in the system, but in some cases (e.g. Magma) it is also useful to expect a proxy for a class to test equivalent to the actual class. Therefore, in SequenceableCollection>>= use #= rather than #== for the class comparison.
The discussion on the list was here:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2019-February/201600....
Dave
Thanks for finding that. But, if you look at the previous version (sma 5/12/2000) of SequenceableCollection>>=, it checks the equivalents of "species" (the same 'kind' of thing in collection). So, replacing that with check equivalents of a "class" introduces a "silent application bug", especially in code, which expects "species" comparison in SequenceableCollection>>= (like RFB I mentioned). Anyway, it is ok to use and upgrade related code to #hasEqualElements: method instead. But someone still can find the difference, that in Set, Bitset, SortedCollection we could use #= for checking equivalents of "species", but in SequenceableCollection - not, starting from Squeak 5.3
Best regards, Nikolai