<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        +1 !! :-) Thanks!<div class="mb_sig"></div><blockquote class='history_container' type='cite' style='border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;'>
                        <p style='color: #AAAAAA; margin-top: 10px;'>Am 11.03.2021 23:49:54 schrieb David T. Lewis <lewis@mail.msen.com>:</p><div style='font-family:Arial,Helvetica,sans-serif'>Every once in a while I find myself hunting around to locate the<br>basic set operations. These should be simple and obvious so I think<br>they deserve their own method category.<br><br>I also added the trivial implementation of #symmetricDifference: because<br>it seemed to be inexplicably missing. Most likely this would benefit from<br>optimization, but the simple implementation is readable and actually<br>looks symmetric, so it seems like a good start.<br><br>OK to move to trunk?<br><br>Dave <br><br><br>On Thu, Mar 11, 2021 at 10:44:44PM +0000, commits@source.squeak.org wrote:<br>> A new version of Collections was added to project The Inbox:<br>> http://source.squeak.org/inbox/Collections-dtl.931.mcz<br>> <br>> ==================== Summary ====================<br>> <br>> Name: Collections-dtl.931<br>> Author: dtl<br>> Time: 11 March 2021, 5:44:43.577146 pm<br>> UUID: 1ed239e3-d108-43c3-8b6e-de8c43d842d1<br>> Ancestors: Collections-nice.930<br>> <br>> Set logic methods should be discoverable, so give them a method category. Add an implementation of Collection>>symmetricDifference: so that the basic set operations of union, intersection, difference, and symmetric difference are available.<br>> <br>> =============== Diff against Collections-nice.930 ===============<br>> <br>> Item was changed:<br>> + ----- Method: Collection>>difference: (in category 'set logic') -----<br>> - ----- Method: Collection>>difference: (in category 'enumerating') -----<br>>   difference: aCollection<br>>    "Answer the set theoretic difference of two collections."<br>>   <br>>      ^ self reject: [:each | aCollection includes: each]!<br>> <br>> Item was changed:<br>> + ----- Method: Collection>>intersection: (in category 'set logic') -----<br>> - ----- Method: Collection>>intersection: (in category 'enumerating') -----<br>>   intersection: aCollection<br>>       "Answer the set theoretic intersection of two collections."<br>>   <br>>    ^ self select: [:each | aCollection includes: each]!<br>> <br>> Item was added:<br>> + ----- Method: Collection>>symmetricDifference: (in category 'set logic') -----<br>> + symmetricDifference: aCollection<br>> +         "Answer the set theoretic symmetric difference of two collections."<br>> + <br>> +  ^ (self difference: aCollection) union: (aCollection difference: self)<br>> + !<br>> <br>> Item was changed:<br>> + ----- Method: Collection>>union: (in category 'set logic') -----<br>> - ----- Method: Collection>>union: (in category 'enumerating') -----<br>>   union: aCollection<br>>        "Answer the set theoretic union of two collections."<br>>   <br>>           ^ self asSet addAll: aCollection; yourself!<br>> <br>> Item was changed:<br>> + ----- Method: HashedCollection>>union: (in category 'set logic') -----<br>> - ----- Method: HashedCollection>>union: (in category 'enumerating') -----<br>>   union: aCollection<br>>         "Answer the set theoretic union of the receiver and aCollection, using the receiver's notion of equality and not side effecting the receiver at all."<br>>   <br>>          ^ self copy addAll: aCollection; yourself<br>>   <br>>   !<br>> <br>> <br><br></div></blockquote>
                                        </div></body>