[squeak-dev] Re: about Dictionary valuesDo:

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Oct 20 19:59:36 UTC 2009


So my plan is currently:

- track #keys usage, and use #asSet where due to be future proof
- this involves inquiring some keys senders like selectors and classVarNames
- publish a mcm
- change keys to behave like fasterKeys
- publish a mcm
- revert fasterKeys senders to just send keys (except the bug I found,
and a few #sort shortcuts)

Don't know if feasible in one evening...

2009/10/20 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
> well, among 49 senders of keys, I see very few problem:
>
> Bag>>#asSet obviously
> Behavior>>#selector the comment tells Set, but is it necessary ?
>
> among 92 usages of selectors
>
> basicLocalSelectors: aSetOrNil
>        localSelectors := aSetOrNil
> traits ? didn't try to follow further
>
> some will use remove which is not an Array protocol (removeAllFoundIn:
> from #replaceSilently:to:)
>
> some usages like class selectors includes: will be a bit less efficient
>
> #classVarNames comment tells a Set, though code would behave as well
> with a sorted collection...
>
> some = test might not work if collection is arbitrarily ordered
> (tempRefs keys = method startpcsToBlockExtents values asSet)
>
> ImageSegment findRogueRootsRefStrm: will use remove:
>
> A few asSet should be necessary.
>
> Nicolas
>
>
> 2009/10/20 Andreas Raab <andreas.raab at gmx.de>:
>> Nicolas Cellier wrote:
>>>>
>>>> Can you provide some examples of places that break?
>>>
>>> Look among 49 remaining senders of keys, a few use usage like #selectors
>>> do.
>>
>> Looking through this, nothing springs to mind that would break. Even places
>> like, e.g., aClass selectors includes: aSelector should continue to work
>> with the one possible exception that in cases where IdentityDictionary keys
>> are used the resulting collection should compare identity not equality,
>> which would be a problem if there were code that expects e.g., Object
>> selectors includes: 'yourself' => false. (that seems rare)
>>
>> But other than that I don't really see anything that would break with the
>> change. Have you tried making the change and just run all the tests to see
>> which ones break and why?
>>
>> Cheers,
>>  - Andreas
>>
>>
>



More information about the Squeak-dev mailing list