I started to implement OrderedSet (OrderedCollection no duplicate) but I think that I want probably UniqueOrdered. I will publish what I have done and ask for feedback and that other can improve. I like the idea of using the TraitsTest to have coherent sets of behavior.
Oh yeah, TreeSet ftw, missed that already sometime!
what is TreeSet?
asSortedArray asSortedCollection asSortedCollection: sortBy:
What bugs me is that #sortBy: does not what it says. I would expect that
aCollection sortBy: [ :each | each name ]
does the same as
aCollection sort: [ :a :b | a name <= b name ]
Is it not that sortBy: should be used like that aCollection sortBy: [ :a :b | a name <= b name ] ?
if you want that, I can provide a fast implementation of #sortBy:
Now what would be good is to have sort: for all the collections so that we can use them polymorphically. I do not really see the use of sortBy: except as a replacement/unification between sortBlock: and sort:. I really think that we should polish the collections. They are the foundation. We should probably have a look at the moose collection extensions you did and we ported to squeak (not all of them). They are published in Moose/CollectionExtensions Stef
--AA
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project