--- a/Iterator.st Thu May 09 18:46:34 1996 +0200
+++ b/Iterator.st Fri May 10 09:59:39 1996 +0200
@@ -117,8 +117,28 @@
j printNL
].
[exEnd]
+ an iterator, simulating a collection of the lines
+ in a file:
+ [exBegin]
+ |i b|
+
+ b := [:whatToDo |
+ |s line|
+
+ s := 'smalltalk.rc' asFilename readStream.
+ [s atEnd] whileFalse:[
+ line := s nextLine.
+ whatToDo value:line.
+ ].
+ s close
+ ].
+
+ i := Iterator on:b.
+ i do:[:j |
+ j printNL
+ ].
+ [exEnd]
"
-
! !
!Iterator class methodsFor:'instance creation'!
@@ -295,5 +315,5 @@
!Iterator class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.2 1996-05-09 12:28:31 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.3 1996-05-10 07:59:39 cg Exp $'
! !