The Inbox: Collections-dtl.821.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Collections-dtl.821.mcz

commits-2
David T. Lewis uploaded a new version of Collections to project The Inbox:
http://source.squeak.org/inbox/Collections-dtl.821.mcz

==================== Summary ====================

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.

=============== Diff against Collections-nice.820 ===============

Item was changed:
  ----- Method: SequenceableCollection>>= (in category 'comparing') -----
  = otherCollection
  "Answer true if the receiver is equivalent to the otherCollection.
  First test for identity, then rule out different class and sizes of
  collections. As a last resort, examine each element of the receiver
  and the otherCollection."
 
  self == otherCollection ifTrue: [^ true].
+ self class = otherCollection class ifFalse: [^ false].
- self class == otherCollection class ifFalse: [^ false].
  ^ self hasEqualElements: otherCollection!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-dtl.821.mcz

Chris Muller-3
OMG, BLESS YOU!!!    :-D

On Sat, Feb 16, 2019 at 5:18 PM <[hidden email]> wrote:

>
> David T. Lewis uploaded a new version of Collections to project The Inbox:
> http://source.squeak.org/inbox/Collections-dtl.821.mcz
>
> ==================== Summary ====================
>
> 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.
>
> =============== Diff against Collections-nice.820 ===============
>
> Item was changed:
>   ----- Method: SequenceableCollection>>= (in category 'comparing') -----
>   = otherCollection
>         "Answer true if the receiver is equivalent to the otherCollection.
>         First test for identity, then rule out different class and sizes of
>         collections. As a last resort, examine each element of the receiver
>         and the otherCollection."
>
>         self == otherCollection ifTrue: [^ true].
> +       self class = otherCollection class ifFalse: [^ false].
> -       self class == otherCollection class ifFalse: [^ false].
>         ^ self hasEqualElements: otherCollection!
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-dtl.821.mcz

Tobias Pape
In reply to this post by commits-2
I like it. :)
+1

> On 17.02.2019, at 00:18, [hidden email] wrote:
>
> David T. Lewis uploaded a new version of Collections to project The Inbox:
> http://source.squeak.org/inbox/Collections-dtl.821.mcz
>
> ==================== Summary ====================
>
> 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.
>
> =============== Diff against Collections-nice.820 ===============
>
> Item was changed:
>  ----- Method: SequenceableCollection>>= (in category 'comparing') -----
>  = otherCollection
>   "Answer true if the receiver is equivalent to the otherCollection.
>   First test for identity, then rule out different class and sizes of
>   collections. As a last resort, examine each element of the receiver
>   and the otherCollection."
>
>   self == otherCollection ifTrue: [^ true].
> + self class = otherCollection class ifFalse: [^ false].
> - self class == otherCollection class ifFalse: [^ false].
>   ^ self hasEqualElements: otherCollection!
>
>