This is a class designed to simplify writing iterator methods. Each instance is a nullary FunctionClosure that serves as the next method for the iterator.
|
|
Each call of next iter is equivalent to iter().
|
|
|
|
Every Iterator object is an iterator for itself.
|
|
However, we cannot "rewind" an Iterator object. Every time that it is iterated upon using for, scan, etc., iteration will resume where it left off previously.
|
|
Contrast this with most other classes with the iterator method installed, like, strings, for which a new Iterator object is created every time it is iterated upon, and so iteration starts over from the beginning
|
|
|
The object Iterator is a self initializing type, with ancestor classes FunctionClosure < Function < Thing.