[squeak-dev] Re: about Dictionary valuesDo:

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Oct 20 08:49:14 UTC 2009


2009/10/20 Andreas Raab <andreas.raab at gmx.de>:
> Hi Nicolas -
>
> I agree with your (original) reasoning that keys should return an array just
> like values. Not only because of performance, but also because it preserves
> ordering between keys and values making "aDict keys with: aDict values do:"
> nicely symmetrical to "aDict keysAndValuesDo:".
>
> Nicolas Cellier wrote:
>>
>> So I gave it a try with a bunch of commits
>> (ouch, commiting is longer than editing!)
>>
>> I used #fasterKeys because the message already exist.
>> I cannot change keys directly, a few senders really expect a Set (plus
>> external packages...)
>
> Which ones are those? I do dislike the idea of using fasterKeys. It's a bad
> name (like using #valuesWithOrder instead of #values) and unless the
> difficulties with the change are systematic (i.e., usage patterns that are
> not easily detected and lead to hidden and hard to find issues) I would much
> rather see this fixed than worked around.
>

Totally agree about the bad name !
My plan was to use this name in an interim period, gradually handle
special cases of methods expecting a Set, change keys to behave as
fasterKeys, then deprecate message fasterKeys.

> Can you provide some examples of places that break?
>

Look among 49 remaining senders of keys, a few use usage like #selectors do.

Nicolas

> Cheers,
>  - Andreas
>
>



More information about the Squeak-dev mailing list