StepThrough

catdef.spad line 1476 [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: infinite repeated nextItem's are never “failed”.

=: (%, %) -> Boolean

from BasicType

~=: (%, %) -> Boolean

from BasicType

coerce: % -> OutputForm

from CoercibleTo OutputForm

init: %

init() chooses an initial object for stepping.

latex: % -> String

from SetCategory

nextItem: % -> Union(%, failed)

nextItem(x) returns the next item, or “failed” if domain is exhausted.

BasicType

CoercibleTo OutputForm

SetCategory