An iterator is an object that is used to traverse through x. Usually, but not necessarily, this will be an instance of the Iterator class.
|
The class of an iterator should have a next method installed that gets the next element of x.
|
|
|
If x contains only a finite number of elements, then next should return the symbol StopIteration after exhausting them all.
|
|
|
|
They can also be passed to apply and select. In each case, an Iterator object will be returned that is an iterator for itself.
|
|
|
|
The object iterator is a method function with a single argument.
The source of this document is in Macaulay2Doc/doc_iterators.m2:106:0.