aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/UNISEG.ht
blob: 229c77c79f23b5bd8586c09f056c10a886fbf2d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
\newcommand{\UniversalSegmentXmpTitle}{UniversalSegment}
\newcommand{\UniversalSegmentXmpNumber}{9.84}
%
% =====================================================================
\begin{page}{UniversalSegmentXmpPage}{9.84 UniversalSegment}
% =====================================================================
\beginscroll

The \spadtype{UniversalSegment} domain generalizes \spadtype{Segment}
by allowing segments without a ``hi'' end point.
\xtc{
}{
\spadpaste{pints  := 1..         \bound{pints}}
}
\xtc{
}{
\spadpaste{nevens := (0..) by -2 \bound{nevens}}
}
\xtc{
Values of type \spadtype{Segment} are automatically converted to
type \spadtype{UniversalSegment} when appropriate.
%-% \HDexptypeindex{Segment}{UniversalSegmentXmpPage}{9.84}{UniversalSegment}
}{
\spadpaste{useg: UniversalSegment(Integer) := 3..10 \bound{useg}}
}
\xtc{
The operation \spadfunFrom{hasHi}{UniversalSegment} is used to test
whether a segment has a \spad{hi} end point.
}{
\spadpaste{hasHi pints  \free{pints}}
}
\xtc{
}{
\spadpaste{hasHi nevens \free{nevens}}
}
\xtc{
}{
\spadpaste{hasHi useg   \free{useg}}
}
\xtc{
All operations available on type \spadtype{Segment} apply to
\spadtype{UniversalSegment}, with the proviso that expansions produce
streams rather than lists.
This is to accommodate infinite expansions.
}{
\spadpaste{expand pints \free{pints}}
}
\xtc{
}{
\spadpaste{expand nevens \free{nevens}}
}
\xtc{
}{
\spadpaste{expand [1, 3, 10..15, 100..]}
}

For more information on related topics,  see
\downlink{`Segment'}{SegmentXmpPage}\ignore{Segment},
\downlink{`SegmentBinding'}{SegmentBindingXmpPage}\ignore{SegmentBinding},
\downlink{`List'}{ListXmpPage}\ignore{List}, and
\downlink{`Stream'}{StreamXmpPage}\ignore{Stream}.
\showBlurb{UniversalSegment}
\endscroll
\autobuttons
\end{page}
%