[squeak-dev] set equality has changed :-(

Tobias Pape Das.Linux at gmx.de
Tue Apr 19 16:52:12 UTC 2016


On 19.04.2016, at 18:11, Eliot Miranda <eliot.miranda at gmail.com> wrote:

> Hi Marcel,
> 
> On Tue, Apr 19, 2016 at 12:32 AM, Tobias Pape <Das.Linux at gmx.de> wrote:
> 
> On 19.04.2016, at 08:23, marcel.taeumel <Marcel.Taeumel at hpi.de> wrote:
> 
> > Hi Eliot,
> >
> > try this:
> > (Set with: #module) includesAllOf: (IdentitySet with: #module).
> >
> > This is "hasEqualElements:" for all kinds of collections.
> 
> But this is not reflexive, right?
> 
> (Set withAll: #(module moep)) includesAllOf: (IdentitySet with: #module)
> 
> How about
> 
> Set>>hasEqualElements: aCollection
>      ^aCollection size = self size and: [aCollection noneSatisfy: [:element| (self includes: element) not]
> 
> 
> Again it's not reflexive with sequenceable collections, but unlike includesAllOf: it meets the specification ;-).

I think I was incorrect, I think what I meant is commutative.

Best
	-Tobias

> 
> 
> 
> >
> > Best,
> > Marcel





More information about the Squeak-dev mailing list