Behavior of HashedCollection>>do:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Behavior of HashedCollection>>do:

Manfred Kröhnert
Hi all,

I just discovered that HashedCollection>>do: only iterates over the
values of the collection.
In contrast, Pharo Smalltalk iterates over the associations when
calling HashedCollection>>do:.

What is the opinion on changing the behavior?
It would ease a refactoring I am currently doing in Amber.

Best,
Manfred
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of HashedCollection>>do:

Nicolas Petton
Hi!

HashedCollection in Amber is quite Amber specific: it represent a map
with strings as keys. And for consistency with Dictionary, I'm quite
happy with the current behavior.

Cheers,
Nico

Manfred Kröhnert <[hidden email]> writes:

> Hi all,
>
> I just discovered that HashedCollection>>do: only iterates over the
> values of the collection.
> In contrast, Pharo Smalltalk iterates over the associations when
> calling HashedCollection>>do:.
>
> What is the opinion on changing the behavior?
> It would ease a refactoring I am currently doing in Amber.
>
> Best,
> Manfred

--
Nicolas Petton
http://nicolas-petton.fr
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of HashedCollection>>do:

Manfred Kröhnert
Hi Nico,

thanks for the answer.
I'll do it differently then.

Best,
Manfred

On Mon, Jul 23, 2012 at 10:05 AM,  <[hidden email]> wrote:

> Hi!
>
> HashedCollection in Amber is quite Amber specific: it represent a map
> with strings as keys. And for consistency with Dictionary, I'm quite
> happy with the current behavior.
>
> Cheers,
> Nico
>
> Manfred Kröhnert <[hidden email]> writes:
>
>> Hi all,
>>
>> I just discovered that HashedCollection>>do: only iterates over the
>> values of the collection.
>> In contrast, Pharo Smalltalk iterates over the associations when
>> calling HashedCollection>>do:.
>>
>> What is the opinion on changing the behavior?
>> It would ease a refactoring I am currently doing in Amber.
>>
>> Best,
>> Manfred
>
> --
> Nicolas Petton
> http://nicolas-petton.fr