catdef.spad line 1477 [edit on github]
A class of objects which can be 'stepped through'. Repeated applications of nextItem is guaranteed never to return duplicate items and only return "failed" after exhausting all elements of the domain. This assumes that the sequence starts with init()
. For infinite domains, repeated application of nextItem is not required to reach all possible domain elements starting from any initial element. Conditional attributes: infiniterepeated nextItem
's
are never "failed".
init()
chooses an initial object for stepping.
nextItem(x)
returns the next item, or "failed" if domain is exhausted.