% 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.63}
%
% =====================================================================
\begin{page}{OrderedVariableListXmpPage}{9.63 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}
%
