Abstraction of ordinal types whose values may
be used as endpoints of a span()
or measure()
.
An Enumerable
type is characterized by each element
having welldefined offset
and neighbour()
functions.
Given an instance x
of an enumerable type X
:
y
of X
with that offset, andy
is an instance of X
, then there is a
welldefined integervalued offset of x
from y
.The offset function must satisfy:
x.offset(x) == 0
, andx.successor.offset(x) == 1
if x!=x.successor
.The neighbour function must satisfy:
x.neighbour(0) == x
,x.neighbour(n1) == x.neighbour(n).predecessor
, andx.neighbour(n+1) == x.neighbour(n).successor
.Of course, it follows that:
x.neighbour(1) == x.predecessor
, andx.neighbour(1) == x.successor
.An enumerable type may be linear or recursive. If X
is a linear enumerable type, then the offset function
satisfies:
x.predecessor.offset(x) == 1
if x!=x.predecessor
,x.offset(y) == y.offset(x)
for any instance y
of X
,
andx.offset(y) == x.offset(z) + z.offset(y)
.Otherwise, X
is a recursive enumerable type with a finite
list of enumerated instances of size count
, and its
offset and neighbour functions must satisfy:
x.neighbour(count)==x
,x.offset(y) >= 0
for any instance y
of X
, andx.predecessor.offset(x) == count  1
.A range of values of an enumerable type may be specified using:
first..last
, orfirst:length
.no type hierarchy
Attributes  
predecessor  shared actual default Other predecessor The predecessor of this value. Refines Ordinal.predecessor 
successor  shared actual default Other successor The successor of this value. Refines Ordinal.successor 
Inherited Attributes 
Attributes inherited from: Object 
Attributes inherited from: Ordinal<Other> 
Methods  
neighbour  shared formal Other neighbour(Integer offset) The indirect successor or predecessor at the given
Throws

offset  shared formal Integer offset(Other other) Compute the offset from the given value, where:
Throws

offsetSign  shared default Integer offsetSign(Other other) The sign of the offset from the given value. 
Inherited Methods 
Methods inherited from: Object 