Digging a bit further, the change from the pointless implementation to
the current implementation was made between Pharo 2.0 and Pharo 3.0
and the current definition was introduced into ST/X some time between
2010 and 2012, which is about the same time as Pharo.
{collect,select,reject}:thenDo: were added to my library on
2004.09.14, exactly a day after the version now in Squeak.�� Which
leads me to believe that I picked the method up from a previous
version of Squeak and that some of the Squeak version history has
been lost.
By the way, it's not just Sets where the current Squeak definition is
a pain in the posterior.�� Consider the following example.
�� |o|
�� o := OrderedCollection new.
�� #[3 1 4 1 5 9]
������ collect: [:byte | byte asFloat]
������ thenDo: [:float | o addLast: float].
�� Transcript print: o; cr.
This works fine in Pharo, in Smalltalk/X, and in my library.
It raises an exception in Squeak.
Or try
���� #[3 1 4 1 5 9]
�������� collect: [:byte | byte odd ifTrue: [byte printString]
�������������������������������������������������������������� ifFalse: [byte]]
�������� thenSelect: [:each | each isNumber]
In Pharo and my library, it straightforwardly answers #[4].
In Squeak, it raises an exception.
So that's sets where the current Squeak definition can give you
trouble, and ByteArrays, and we are not done yet!�� Pretty much
anything other than an Array or an OrderedCollection is going to
get you in trouble in Squeak.�� Just think of the fun you can
have with SortedCollection.�� Ooh, the list goes on and on.
So, the Squeak definition
* does not improve readability.
�� In fact, it REDUCES readability because the human reader stops
�� to ask "why is this portmanteau method used rather than the
�� obvious code" and several minutes later discovers that there
�� is NO reason.
* is useless with most collection classes.
* does nothing to improve performance but just adds overhead.
Are we done yet?