--- a/Collection.st Fri Mar 21 19:30:58 2003 +0100
+++ b/Collection.st Mon Mar 24 18:18:24 2003 +0100
@@ -521,23 +521,13 @@
"return the second element of the collection.
For unordered collections, this simply returns the second
element when enumerating them.
- Bla Bla This should be redefined in subclasses."
-
- |count|
-
- count := 1.
- self do:[:e |
- count == 2 ifTrue:[^ e].
- count := count + 1
- ].
-
- "error if collection is smaller"
- ^ self notEnoughElementsError
+ This should be redefined in subclasses."
+
+ ^ self nth:2
"
#(1 2 3) second
"
-
!
seventh
@@ -2484,7 +2474,7 @@
!Collection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.136 2003-03-02 20:39:30 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.137 2003-03-24 17:18:24 cg Exp $'
! !
Collection initialize!