--- a/OrderedCollection.st Fri May 10 14:08:59 1996 +0200
+++ b/OrderedCollection.st Fri May 10 14:10:57 1996 +0200
@@ -1222,19 +1222,6 @@
!OrderedCollection methodsFor:'searching'!
-after:anObject
- "return the element, after anObject.
- If anObject is not in the receiver, report an error."
-
- ^ self after:anObject ifAbsent:[self errorValueNotFound:anObject]
-
- "
- #(4 3 2 1) asOrderedCollection after:3.
- #(4 3 2 1) asOrderedCollection after:5
- #(4 3 2 1) asOrderedCollection after:1
- "
-!
-
after:anObject ifAbsent:exceptionBlock
"return the element after the argument anObject, nil if there is none.
If anObject is not in the receiver, return the result from evaluating exceptionBlock."
@@ -1243,29 +1230,19 @@
idx := self indexOf:anObject.
idx ~~ 0 ifTrue:[
- idx == lastIndex ifTrue:[^ nil].
- ^ self at:(idx + 1).
+ idx == lastIndex ifTrue:[^ nil].
+ ^ self at:(idx + 1).
].
^ exceptionBlock value
"
#(4 3 2 1) asOrderedCollection after:3.
+ #(4 3 3 1) asOrderedCollection after:3. <- what should be returned here ?
#(4 3 2 1) asOrderedCollection after:5
#(4 3 2 1) asOrderedCollection after:1
"
-!
-before:anObject
- "return the element before the argument, anObject.
- If anObject is not in the receiver, report an error."
-
- ^ self before:anObject ifAbsent:[self errorValueNotFound:anObject]
-
- "
- #(4 3 2 1) asOrderedCollection before:3.
- #(4 3 2 1) asOrderedCollection before:4
- #(4 3 2 1) asOrderedCollection before:0
- "
+ "Modified: 10.5.1996 / 14:07:28 / cg"
!
before:anObject ifAbsent:exceptionBlock
@@ -1276,8 +1253,8 @@
idx := self indexOf:anObject.
idx ~~ 0 ifTrue:[
- idx == firstIndex ifTrue:[^ nil].
- ^ self at:(idx - 1).
+ idx == firstIndex ifTrue:[^ nil].
+ ^ self at:(idx - 1).
].
^ exceptionBlock value
@@ -1285,8 +1262,11 @@
#(4 3 2 1) asOrderedCollection before:3.
#(4 3 2 1) asOrderedCollection before:5
#(4 3 2 1) asOrderedCollection before:1
+ #(4 2 1 1) asOrderedCollection before:1
#(4 3 2 1) asOrderedCollection before:4
"
+
+ "Modified: 10.5.1996 / 14:07:55 / cg"
! !
!OrderedCollection methodsFor:'testing'!
@@ -1395,5 +1375,5 @@
!OrderedCollection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.49 1996-04-30 18:03:58 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.50 1996-05-10 12:10:35 cg Exp $'
! !