aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/OVAR.ht
blob: c6ccb3adfe4b1566d0d423ff7a4b094978021e13 (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
% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
\newcommand{\OrderedVariableListXmpTitle}{OrderedVariableList}
\newcommand{\OrderedVariableListXmpNumber}{9.59}
%
% =====================================================================
\begin{page}{OrderedVariableListXmpPage}{9.59 OrderedVariableList}
% =====================================================================
\beginscroll
%

The domain \spadtype{OrderedVariableList} provides symbols
which are restricted to a particular list and have a definite 
ordering. Those two features are specified by a \spadtype{List Symbol}
object that is the argument to the domain.
\xtc{
This is a sample ordering of three symbols.
}{
\spadpaste{ls:List Symbol:=['x,'a,'z] \bound{ls}}
}
\xtc{
Let's build the domain
}{
\spadpaste{Z:=OVAR ls \bound{Z} \free{ls}}
}
\xtc{
How many variables does it have?
}{
\spadpaste{size()$Z \free{Z}}
}
\xtc{
They are (in the imposed order)
}{
\spadpaste{lv:=[index(i::PI)$Z for i in 1..size()$Z] \bound{lv}\free{Z}}
}
\xtc{
Check that the ordering is right
}{
\spadpaste{sorted?(>,lv) \free{lv}}
}
\endscroll
\autobuttons
\end{page}
%