Hello Squeakers!
I've been dazed and confused ((C)Led Zeppelin) by SortedCollection.
| collection | collection := SortedCollection new. collection sortBlock: [:element1 :element2 | element1 > element2]. 1 to: 10 do: [:i | collection add: i]. Transcript cr; show: (collection copyFrom: 1 to: 5) printString
Got SortedCollection (6 7 8 9 10 ), although expected SortedCollection (10 9 8 7 6 ). I think that SortedCollection (6 7 8 9 10 ) has sortBlock: [:x :y | x <= y] (default) *not* [:x :y | x > y] (required). Is it right?
Here is my first aid.
'From Squeak 2.0 of May 22, 1998 on 29 August 1998 at 3:43:36 am'!
!SortedCollection methodsFor: 'copying' stamp: 'nishis 8/29/1998 03:43'! copyFrom: startIndex to: endIndex "by nishis, 1998/08/29 03:42"
| targetCollection | targetCollection := super copyFrom: startIndex to: endIndex. targetCollection sortBlock: sortBlock. ^targetCollection! !
regards