[squeak-dev] Re: about Dictionary valuesDo:
Bert Freudenberg
bert at freudenbergs.de
Tue Oct 20 08:49:29 UTC 2009
On 20.10.2009, at 06:54, Andreas Raab wrote:
> 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.
>
> Can you provide some examples of places that break?
>
> Cheers,
> - Andreas
Yes, #fasterKeys is ugly. I'd rather replace the places that need a
Set with "keys asSet". Unless ANSI says differently - could someone
check?
- Bert -
More information about the Squeak-dev
mailing list
|