Iterator.st
changeset 1425 878a733c9152
parent 1036 adba1c8714bd
child 1755 0b3ac4061db2
equal deleted inserted replaced
1424:459c00460dc0 1425:878a733c9152
   324     ^0
   324     ^0
   325 !
   325 !
   326 
   326 
   327 findLast: aBlock
   327 findLast: aBlock
   328     "Answer the index of the last element of the receiver
   328     "Answer the index of the last element of the receiver
   329     for which aBlock evaluates as true."
   329      for which aBlock evaluates as true."
   330 
   330 
   331     | index last |
   331     | index last |
   332     index := 1.
   332     index := 1.
   333     last := 0.
   333     last := 0.
   334     self do: [ :el | (aBlock value: el) ifTrue: [last := index].  index := index + 1].
   334     self do: [ :el | (aBlock value: el) ifTrue: [last := index].  index := index + 1].
   375 ! !
   375 ! !
   376 
   376 
   377 !Iterator class methodsFor:'documentation'!
   377 !Iterator class methodsFor:'documentation'!
   378 
   378 
   379 version
   379 version
   380     ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.14 2002-05-15 08:27:02 cg Exp $'
   380     ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.15 2004-03-15 11:44:48 ca Exp $'
   381 ! !
   381 ! !