A suggestion
Henrik Gedenryd
h.gedenryd at open.ac.uk
Tue Mar 12 10:07:58 UTC 2002
Richard A. O'Keefe wrote:
> A key step in the algorithm is sorting a collection of (sorted)
> sequences of integers. I was using an OrderedCollection of Arrays of
> (numbers that happen to be) SmallIntegers. The obvious
> candidates sort
> doesn't work because you can't use #< between two Arrays.
Avoiding the discussion of sorting performance, you can provide a sort block
to SortedCollections, which then could be something like
[:a :b |
(1 to: (a size min: b size)) allSatisfy: [:i |
(a at: i) <= (b at: i)]]
This avoids writing an extra method.
Henrik
More information about the Squeak-dev
mailing list
|