Levente Uzonyi <le...@...> writes:

>   #equalsTo:
>     misleading name, #containsSameElementsAs: would be better IMO
>     #(1 1 2) equalsTo: #(2 1 1) ===> true

There is a #sameElements: in roel typer package. I think #sameElementsAs: and
 #sameSequenceAs: would be nice method names for methods that test for same
 elements and same elements in same order.

>   #flatCollect: -> #gather:
>   #flatCollectAsSet: -> #gather: + #asSet

NB: #gather always returns an array, should use species.

>   #groupBy: -> #groupBy:having:

Does not have the same behavior! #groupBy:having: requires that "keyBlock
 should return an Integer" whereas #groupedBy: works with any values (except
 nil) returned from the the block.  

>  #sum: -> #detectSum:

Short names and readability, anyone? Also the name is misleading, #detect:
 returns an element of the collection, #detectSum not. For maximum it makes
 sense to have both #detectMax: (which returns the element with the max value)
 and #max: (which returns the max value).

> SequenceableCollection >>
>   #shuffle -> #shuffled

NB: #shuffledBy: should use `i atRandom:` rather than `(1 to: i) atRandom:`
 to avoid creating an interval object for each element of the collection.

> OrderedCollection >>
>   #removeAtIndex: -> #removeAt:

Shorter name, nice! :)

--AA


_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to