[Pharo-project] Collection extensions

Lukas Renggli renggli at gmail.com
Mon Jan 5 09:56:46 EST 2009

> I published to the inbox some cool collection extension methods that
> we use all the time in Moose.
> flatCollect:, collectAsSet:, and groupedBy:

I think Squeak already has far too many of these methods. I would
rather like to see them all removed, than new ones added. As an author
and maintainer of many Smalltalk framework I experience daily the pain
such methods cause, as they are inherently non-portable not only
between smalltalk dialects but even between users of exactly the same

Let me give you an example: Seaside used
SequenceableCollection>>#pairsDo: in various places. The we got
complaints that almost all Smalltalk platforms already provide such a
method, but they all implement it entirely different. Some iterate
over the combinatorial pairs, some over the consecutive pairs, some
ignore an odd number of arguments, some raise an exception, etc. At
some point we learned that a famous company using Seaside has their
own proprietary override of this method. Today we use the ANSI
#to:do:. It is ugly, but it works everywhere as it is part of ANSI

I would prefer to have such extension methods separate from the core.


Lukas Renggli

More information about the Pharo-dev mailing list