Hello all,
We have
(Bag with: 1 with: 1 with: 1) intersection: (Bag with: 1) --> (Bag with: 1 with: 1 with: 1)
and:
(Bag with: 1) intersection: (Bag with: 1 with: 1 with: 1) --> (Bag with: 1)
Is that a bug or a feature?
I would expect (Bag with: 1) in both cases.
Stef
Nice finding! Probably we should override all #difference: #intersection: #symmetricDifference: #union: in Bag to have multiset semantics.
Best,
Christoph
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Stéphane Rollandin lecteur@zogotounga.net Gesendet: Donnerstag, 5. Januar 2023 17:18:58 An: liste [Squeak-dev] Betreff: [squeak-dev] Intersection of Bags
Hello all,
We have
(Bag with: 1 with: 1 with: 1) intersection: (Bag with: 1) --> (Bag with: 1 with: 1 with: 1)
and:
(Bag with: 1) intersection: (Bag with: 1 with: 1 with: 1) --> (Bag with: 1)
Is that a bug or a feature?
I would expect (Bag with: 1) in both cases.
Stef
We have
(Bag with: 1 with: 1 with: 1) intersection: (Bag with: 1) --> (Bag with: 1 with: 1 with: 1)
and:
(Bag with: 1) intersection: (Bag with: 1 with: 1 with: 1) --> (Bag with: 1)
Is that a bug or a feature?
Such abstract behavior can't be classified as either. The decision has to be based on the receiver of #intersection: message. Note Array behaves the same.
Best, Chris
squeak-dev@lists.squeakfoundation.org