--- a/Iterator.st Mon Sep 28 11:35:50 2009 +0200
+++ b/Iterator.st Mon Sep 28 15:25:27 2009 +0200
@@ -263,14 +263,14 @@
!
indexOf: anElement ifAbsent: exceptionBlock
- "Answer the index of anElement within the receiver. If the receiver does
- not contain anElement, answer the result of evaluating the exceptionBlock."
-
+ "Answer the index of anElement within the receiver. If the receiver does
+ not contain anElement, answer the result of evaluating the exceptionBlock."
| index |
+
index := 1.
self do: [ :el | el = anElement ifTrue: [^index]. index := index + 1].
- ^exceptionBlock value
+ ^ exceptionBlock value
! !
!Iterator methodsFor:'adding & removing'!
@@ -391,5 +391,5 @@
!Iterator class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.20 2009-05-18 14:48:05 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.21 2009-09-28 13:25:27 cg Exp $'
! !