aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/VOID.ht
blob: 4dc87ca33b37eb0c9137f3ed8e9bc0104771acc8 (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
% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
\newcommand{\VoidXmpTitle}{Void}
\newcommand{\VoidXmpNumber}{9.86}
%
% =====================================================================
\begin{page}{VoidXmpPage}{9.86 Void}
% =====================================================================
\beginscroll

When an expression is not in a value context, it is given type \spadtype{Void}.
For example, in the expression
\begin{verbatim}
r := (a; b; if c then d else e; f)
\end{verbatim}
values are used only from the subexpressions \spad{c} and \spad{f}: all
others are thrown away.
The subexpressions \spad{a}, \spad{b}, \spad{d} and \spad{e}
are evaluated for side-effects only and have type \spadtype{Void}.
There is a unique value of type \spadtype{Void}.

\xtc{
You will most often see results of type \spadtype{Void} when you
declare a variable.
}{
\spadpaste{a : Integer}
}
\noOutputXtc{
Usually no output is displayed for \spadtype{Void} results.
You can force the display of a rather ugly object by issuing
\spadcmd{)set message void on}.
%-% \HDsyscmdindex{set message void}{VoidXmpPage}{9.86}{Void}
}{
\spadpaste{)set message void on}
}
\xtc{
}{
\spadpaste{b : Fraction Integer}
}
\noOutputXtc{
}{
\spadpaste{)set message void off}
}
\xtc{
All values can be converted to type \spadtype{Void}.
}{
\spadpaste{3::Void \bound{prev}}
}
\xtc{
Once a value has been converted to \spadtype{Void}, it cannot be recovered.
}{
\spadpaste{\% :: PositiveInteger \free{prev}}
}
\endscroll
\autobuttons
\end{page}
%