[squeak-dev] set equality has changed :-(
Eliot Miranda
eliot.miranda at gmail.com
Tue Apr 19 16:08:50 UTC 2016
On Mon, Apr 18, 2016 at 5:18 PM, Levente Uzonyi <leves at caesar.elte.hu>
wrote:
> On Mon, 18 Apr 2016, Eliot Miranda wrote:
>
>
>>
>> On Mon, Apr 18, 2016 at 3:43 PM, Levente Uzonyi <leves at caesar.elte.hu>
>> wrote:
>> Hi Eliot,
>>
>> On Mon, 18 Apr 2016, Eliot Miranda wrote:
>>
>> Hi All,
>> this used to work:
>>
>> (Set with: #module) = (IdentitySet with: #module)
>>
>> when did this change and why?
>>
>>
>> I changed it in Collections-ul.669 last November, because it didn't
>> work well. Let's see a different example:
>>
>> | s i |
>> s := Set with: 'module' copy.
>> i := IdentitySet with: 'module' copy.
>> {
>> s = i.
>> i = s
>> }
>>
>> The old implementation would return #(false true), while the new
>> one evaluates to #(false false).
>>
>>
>> Right. That's a pain, but fair enough. This is clumsy: (aSet size = 1
>> and: [aSet anyOne = #module]). This slightly less so: aSet = (aSet
>> species with: #module).
>>
>
> You could also write it as
>
> aSet asArray = #(module).
>
> or as
>
> (aSet as: Set) = (Set with: #module).
Expensive when aSet is large. I've gone with the anyOne form.
> Levente
>
>
>
>> Levente
>>
>> _,,,^..^,,,_
>> best, Eliot
>>
>>
>> _,,,^..^,,,_
>> best, Eliot
>>
>
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160419/89748714/attachment.htm
More information about the Squeak-dev
mailing list
|