Iterator.st
changeset 355 6d4757eab329
parent 294 859e8e4e8c4a
child 457 c862c91716b6
--- a/Iterator.st	Sat May 25 15:54:02 1996 +0200
+++ b/Iterator.st	Sat May 25 16:21:08 1996 +0200
@@ -3,23 +3,23 @@
  The above file is a Manchester Goodie protected by copyright.
  These conditions are imposed on the whole Goodie, and on any significant
  part of it which is separately transmitted or stored:
-        * You must ensure that every copy includes this notice, and that
-          source and author(s) of the material are acknowledged.
-        * These conditions must be imposed on anyone who receives a copy.
-        * The material shall not be used for commercial gain without the prior
-          written consent of the author(s).
+	* You must ensure that every copy includes this notice, and that
+	  source and author(s) of the material are acknowledged.
+	* These conditions must be imposed on anyone who receives a copy.
+	* The material shall not be used for commercial gain without the prior
+	  written consent of the author(s).
  Further information on the copyright conditions may be obtained by
  sending electronic mail:
-        To: goodies-lib@cs.man.ac.uk
-        Subject: copyright
+	To: goodies-lib@cs.man.ac.uk
+	Subject: copyright
  or by writing to The Smalltalk Goodies Library Manager, Dept of
  Computer Science, The University, Manchester M13 9PL, UK
 
  (C) Copyright 1992 University of Manchester
  For more information about the Manchester Goodies Library (from which 
  this file was distributed) send e-mail:
-        To: goodies-lib@cs.man.ac.uk
-        Subject: help 
+	To: goodies-lib@cs.man.ac.uk
+	Subject: help 
 "
 
 
@@ -41,23 +41,23 @@
  The above file is a Manchester Goodie protected by copyright.
  These conditions are imposed on the whole Goodie, and on any significant
  part of it which is separately transmitted or stored:
-        * You must ensure that every copy includes this notice, and that
-          source and author(s) of the material are acknowledged.
-        * These conditions must be imposed on anyone who receives a copy.
-        * The material shall not be used for commercial gain without the prior
-          written consent of the author(s).
+	* You must ensure that every copy includes this notice, and that
+	  source and author(s) of the material are acknowledged.
+	* These conditions must be imposed on anyone who receives a copy.
+	* The material shall not be used for commercial gain without the prior
+	  written consent of the author(s).
  Further information on the copyright conditions may be obtained by
  sending electronic mail:
-        To: goodies-lib@cs.man.ac.uk
-        Subject: copyright
+	To: goodies-lib@cs.man.ac.uk
+	Subject: copyright
  or by writing to The Smalltalk Goodies Library Manager, Dept of
  Computer Science, The University, Manchester M13 9PL, UK
 
  (C) Copyright 1992 University of Manchester
  For more information about the Manchester Goodies Library (from which 
  this file was distributed) send e-mail:
-        To: goodies-lib@cs.man.ac.uk
-        Subject: help 
+	To: goodies-lib@cs.man.ac.uk
+	Subject: help 
 "
 
 !
@@ -65,7 +65,7 @@
 documentation
 "
     Occasionally you may have a block that when evaluated can be
-    treated as a collection -- ie it takes another block as parameter,
+    treated as a collection -- i.e. it takes another block as parameter,
     then applies that to a sequence of values.
 
     This goodie wraps the block into an object -- an iterator -- which is
@@ -73,26 +73,26 @@
     useful collection-related methods.
 
     [info:]
-        NAME            Iterator
-        AUTHOR          miw@cs.man.ac.uk (Mario Wolczko)
-        FUNCTION        a wrapper for blocks that iterate over collections
-        ST-VERSION      4.0 4.1
-        PREREQUISITES   
-        CONFLICTS
-        DISTRIBUTION    world
-        VERSION         1
-        DATE    18 Jun 1991
-        SUMMARY
+	NAME            Iterator
+	AUTHOR          miw@cs.man.ac.uk (Mario Wolczko)
+	FUNCTION        a wrapper for blocks that iterate over collections
+	ST-VERSION      4.0 4.1
+	PREREQUISITES   
+	CONFLICTS
+	DISTRIBUTION    world
+	VERSION         1
+	DATE    18 Jun 1991
+	SUMMARY
 
     [organisation:]
-        Dept. of Computer Science   Internet:      mario@cs.man.ac.uk
-        The University              uucp:        uknet!!!!man.cs!!!!mario
-        Manchester M13 9PL          JANET:         mario@uk.ac.man.cs
-        U.K.                        Tel: +44-61-275 6146  (FAX: 6236)
-        ______the mushroom project___________________________________
+	Dept. of Computer Science   Internet:      mario@cs.man.ac.uk
+	The University              uucp:        uknet!!!!man.cs!!!!mario
+	Manchester M13 9PL          JANET:         mario@uk.ac.man.cs
+	U.K.                        Tel: +44-61-275 6146  (FAX: 6236)
+	______the mushroom project___________________________________
 
     [author:]
-        Mario Wolczko miw@cs.man.ac.uk
+	Mario Wolczko miw@cs.man.ac.uk
 "
 
 !
@@ -100,44 +100,44 @@
 examples
 "
  an iterator, simulating a collection of 100 random values:
-                                                                        [exBegin]
+									[exBegin]
      |i b|
 
      b := [:whatToDo |
-               |rnd|
+	       |rnd|
 
-               rnd := Random new.
-               1 to:100 do:[:i | 
-                  whatToDo value:(rnd next)
-               ] 
-          ].
+	       rnd := Random new.
+	       1 to:100 do:[:i | 
+		  whatToDo value:(rnd next)
+	       ] 
+	  ].
 
      i := Iterator on:b.
      i do:[:j |
-        j printNL
+	j printNL
      ].
-                                                                        [exEnd]
+									[exEnd]
  an iterator, simulating a collection of the lines
  in a file:
-                                                                        [exBegin]
+									[exBegin]
      |i b|
 
      b := [:whatToDo |
-               |s line|
+	       |s line|
 
-               s := 'smalltalk.rc' asFilename readStream.
-               [s atEnd] whileFalse:[
-                  line := s nextLine.
-                  whatToDo value:line.
-               ].
-               s close
-          ].
+	       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
+	j printNL
      ].
-                                                                        [exEnd]
+									[exEnd]
 "
 ! !
 
@@ -150,14 +150,14 @@
      |i b|
 
      b := [:whatToDo | 
-               1 to:10 do:[:i | 
-                  whatToDo value:i
-               ] 
-          ].
+	       1 to:10 do:[:i | 
+		  whatToDo value:i
+	       ] 
+	  ].
 
      i := Iterator on:b.
      i do:[:j |
-        j printNL
+	j printNL
      ].
     "
 
@@ -167,17 +167,17 @@
      |i b|
 
      b := [:whatToDo |
-               |rnd|
+	       |rnd|
 
-               rnd := Random new.
-               1 to:100 do:[:i | 
-                  whatToDo value:(rnd next)
-               ] 
-          ].
+	       rnd := Random new.
+	       1 to:100 do:[:i | 
+		  whatToDo value:(rnd next)
+	       ] 
+	  ].
 
      i := Iterator on:b.
      i do:[:j |
-        j printNL
+	j printNL
      ].
     "
 
@@ -193,7 +193,7 @@
      rnd := Random new.
      i := Iterator on:[:a | rnd next].
      i do:[:j |
-        j printNL
+	j printNL
      ].
     "
 
@@ -315,5 +315,5 @@
 !Iterator class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.3 1996-05-10 07:59:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Iterator.st,v 1.4 1996-05-25 14:21:08 cg Exp $'
 ! !