[squeak-dev] Re: Dictionary>>collect: returning OrderedCollection?

K. K. Subramaniam subbukk at gmail.com
Sat Jun 14 06:09:43 UTC 2008


On Saturday 14 Jun 2008 12:36:54 am nicolas cellier wrote:
> tim Rowledge a écrit :
> > Dictionary>do: etc work on the values of the associations. #collect:
> > should continue the pattern. #associationsDo: etc exist if you need to
> > work with the associations.
> >
> > tim
> > --
> > tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> > Artificial Intelligence:  Making computers behave like they do in the
> > movies.
>
> Hi tim and Subbu,
> you follow a certain historical logic.
> But behaviour could be much simpler and homogeneous with ANSI POV.
ANSI v1.9 [1] treats collect: as a transformer and only requires it to return 
a collection. Returning a dictionary is a permitted 'refinement'.

> Consider current state of Squeak:
>
> 1) select: and reject: already return a Dictionary
This is a non-sequitur. select:/reject: are discriminators while collect: is a 
transformer.

> Original st-80 logic would have been to answer a Bag, nothing else.
:-/. In ST-80, Dictionary isa Set isa Collection while Bag isa Collection. You 
meant a Set, perhaps?

[1] http://wiki.squeak.org/squeak/uploads/172/standard_v1_9-indexed.pdf

Subbu



More information about the Squeak-dev mailing list