Macaulay2 » Documentation
Packages » Macaulay2Doc :: next
next | previous | forward | backward | up | index | toc

next -- get the next object from an iterator

Synopsis

Description

This gets the next object from an iterator, i.e., something returned by iterator.

i1 : iter = iterator {1, 2, 3}

o1 = iterator {1, 2, 3}

o1 : Iterator
i2 : next iter

o2 = 1
i3 : next iter

o3 = 2
i4 : next iter

o4 = 3

If the iterator is exhausted, then the symbol StopIteration is returned.

i5 : next iter

o5 = StopIteration

o5 : Symbol

See also

Ways to use next :

For the programmer

The object next is a method function.