aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/SEGBIND.ht
blob: bec87f27f124531f72f3787029f80db9d130a943 (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
% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
\newcommand{\SegmentBindingXmpTitle}{SegmentBinding}
\newcommand{\SegmentBindingXmpNumber}{9.70}
%
% =====================================================================
\begin{page}{SegmentBindingXmpPage}{9.70 SegmentBinding}
% =====================================================================
\beginscroll

The \spadtype{SegmentBinding} type is used
to indicate a range for a named symbol.

\labelSpace{2pc}
\xtc{
First give the symbol, then an \spadSyntax{=} and finally a
segment of values.
}{
\spadpaste{x = a..b}
}
\xtc{
This is used to provide a convenient
syntax for arguments to certain operations.
}{
\spadpaste{sum(i**2, i = 0..n)}
}
\graphpaste{draw(x**2, x = -2..2)}

\xtc{
The left-hand side must be of type \spadtype{Symbol} but the
right-hand side can be a segment over any type.
}{
\spadpaste{sb := y = 1/2..3/2 \bound{sb}}
}
\xtc{
The left- and right-hand sides can be obtained using the
\spadfunFrom{variable}{SegmentBinding} and
\spadfunFrom{segment}{SegmentBinding} operations.
}{
\spadpaste{variable(sb) \free{sb}}
}
\xtc{
}{
\spadpaste{segment(sb)  \free{sb}}
}

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