# SegmentExpansionCategory(S, L)ΒΆ

seg.spad line 50 [edit on github]

S: OrderedRing

L: StreamAggregate S

This category provides an interface for expanding segments to a stream of elements.

- +: (%, S) -> %
from SegmentCategory S

- +: (S, %) -> %
from SegmentCategory S

- -: (%, S) -> %
from SegmentCategory S

- BY: (%, Integer) -> %
from SegmentCategory S

- coerce: % -> OutputForm
from CoercibleTo OutputForm

- convert: % -> InputForm if S has ConvertibleTo InputForm
from ConvertibleTo InputForm

- convert: S -> %
from SegmentCategory S

- expand: % -> L
`expand(l..h by k)`

creates value of type`L`

with elements`l, l+k, ... lN`

where`lN <= h < lN+k`

. For example,`expand(1..5 by 2) = [1, 3, 5]`

.

- expand: List % -> L
`expand(l)`

creates a new value of type`L`

in which each segment`l..h by k`

is replaced with`l, l+k, ... lN`

, where`lN <= h < lN+k`

. For example,`expand [1..4, 7..9] = [1, 2, 3, 4, 7, 8, 9]`

.

- high: % -> S
from SegmentCategory S

- incr: % -> Integer
from SegmentCategory S

- latex: % -> String
from SetCategory

- low: % -> S
from SegmentCategory S

- map: (S -> S, %) -> L
`map(f, l..h by k)`

produces a value of type`L`

by applying`f`

to each of the successive elements of the segment, that is,`[f(l), f(l+k), ..., f(lN)]`

, where`lN <= h < lN+k`

.

- reverse: % -> %
from SegmentCategory S

- segment: (S, S) -> %
from SegmentCategory S

- SEGMENT: (S, S) -> %
from SegmentCategory S

ConvertibleTo InputForm if S has ConvertibleTo InputForm