aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/EQTBL.ht
diff options
context:
space:
mode:
Diffstat (limited to 'src/hyper/pages/EQTBL.ht')
-rw-r--r--src/hyper/pages/EQTBL.ht55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/hyper/pages/EQTBL.ht b/src/hyper/pages/EQTBL.ht
new file mode 100644
index 00000000..2e5680b9
--- /dev/null
+++ b/src/hyper/pages/EQTBL.ht
@@ -0,0 +1,55 @@
+% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
+% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
+\newcommand{\EqTableXmpTitle}{EqTable}
+\newcommand{\EqTableXmpNumber}{9.18}
+%
+% =====================================================================
+\begin{page}{EqTableXmpPage}{9.18 EqTable}
+% =====================================================================
+\beginscroll
+%
+
+The \spadtype{EqTable} domain provides tables where the keys are compared
+%-% \HDindex{table}{EqTableXmpPage}{9.18}{EqTable}
+using \spadfunFrom{eq?}{EqTable}.
+Keys are considered equal only if they are the same instance of a
+structure.
+This is useful if the keys are themselves updatable structures.
+Otherwise, all operations are the same as for type \spadtype{Table}.
+See \downlink{`Table'}{TableXmpPage}\ignore{Table} for general information about tables.
+\showBlurb{EqTable}
+
+\xtc{
+The operation \spadfunFrom{table}{EqTable} is here used to create a table
+where the keys are lists of integers.
+}{
+\spadpaste{e: EqTable(List Integer, Integer) := table() \bound{e}}
+}
+\xtc{
+These two lists are equal according to \spadopFrom{=}{List},
+but not according to \spadfunFrom{eq?}{List}.
+}{
+\spadpaste{l1 := [1,2,3] \bound{l1}}
+}
+\xtc{
+}{
+\spadpaste{l2 := [1,2,3] \bound{l2}}
+}
+\xtc{
+Because the two lists are not \spadfunFrom{eq?}{List}, separate values
+can be stored under each.
+}{
+\spadpaste{e.l1 := 111 \free{e l1} \bound{e1}}
+}
+\xtc{
+}{
+\spadpaste{e.l2 := 222 \free{e1 l2} \bound{e2}}
+}
+\xtc{
+}{
+\spadpaste{e.l1 \free{e2 l1}}
+}
+\endscroll
+\autobuttons
+\end{page}
+%