Thicker frames around default values.
[clqr.git] / clqr-types-and-classes.tex
blob5e0300ea19b8cd1bc3301176d96b8db0c0cb7dfe
1 % Copyright (C) 2008, 2009, 2010 Bert Burgemeister
3 % Permission is granted to copy, distribute and/or modify this
4 % document under the terms of the GNU Free Documentation License,
5 % Version 1.2 or any later version published by the Free Software
6 % Foundation; with no Invariant Sections, no Front-Cover Texts and
7 % no Back-Cover Texts. For details see file COPYING.
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 \section{Types and Classes}
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 \begin{figure}
15 \begin{center}
16 \begin{sideways}
17 \includegraphics{clqr-types-and-classes.1}
18 \end{sideways}
19 \end{center}
20 \caption[]{Precedence Order of System Classes
21 (\includegraphics{clqr-types-and-classes.3}),
22 Classes (\includegraphics{clqr-types-and-classes.4}),
23 Types (\includegraphics{clqr-types-and-classes.2}), and
24 Condition Types
25 (\includegraphics{clqr-types-and-classes.5}).
26 \label{data-types}%
28 \index{*@\A}%
29 \index{T}%
30 \index{ATOM}%
31 \index{READTABLE}%
32 \index{PACKAGE}%
33 \index{SYMBOL}%
34 \index{KEYWORD}%
35 \index{BOOLEAN}%
36 \index{RESTART}%
37 \index{RANDOM-STATE}%
38 \index{HASH-TABLE}%
39 \index{STRUCTURE-OBJECT}%
40 \index{STANDARD-OBJECT}%
41 \index{NULL}%
42 \index{CLASS}%
43 \index{BUILT-IN-CLASS}%
44 \index{STANDARD-CLASS}%
45 \index{STRUCTURE-CLASS}%
46 \index{METHOD}%
47 \index{STANDARD-METHOD}%
48 \index{METHOD-COMBINATION}%
49 \index{CHARACTER}%
50 \index{FUNCTION}%
51 \index{COMPILED-FUNCTION}%
52 \index{GENERIC-FUNCTION}%
53 \index{STANDARD-GENERIC-FUNCTION}%
54 \index{PATHNAME}%
55 \index{LOGICAL-PATHNAME}%
56 \index{NUMBER}%
57 \index{COMPLEX}%
58 \index{REAL}%
59 \index{FLOAT}%
60 \index{SHORT-FLOAT}%
61 \index{SINGLE-FLOAT}%
62 \index{DOUBLE-FLOAT}%
63 \index{LONG-FLOAT}%
64 \index{RATIONAL}%
65 \index{INTEGER}%
66 \index{RATIO}%
67 \index{SIGNED-BYTE}%
68 \index{FIXNUM}%
69 \index{BIGNUM}%
70 \index{UNSIGNED-BYTE}%
71 \index{BIT}%
72 \index{LIST}%
73 \index{SEQUENCE}%
74 \index{CONS}%
75 \index{ARRAY}%
76 \index{SIMPLE-ARRAY}%
77 \index{VECTOR}%
78 \index{STRING}%
79 \index{SIMPLE-STRING}%
80 \index{BASE-STRING}%
81 \index{SIMPLE-BASE-STRING}%
82 \index{SIMPLE-VECTOR}%
83 \index{BIT-VECTOR}%
84 \index{SIMPLE-BIT-VECTOR}%
85 \index{STREAM}%
86 \index{FILE-STREAM}%
87 \index{TWO-WAY-STREAM}%
88 \index{SYNONYM-STREAM}%
89 \index{STRING-STREAM}%
90 \index{BROADCAST-STREAM}%
91 \index{CONCATENATED-STREAM}%
92 \index{ECHO-STREAM}%
93 \index{EXTENDED-CHAR}%
94 \index{BASE-CHAR}%
95 \index{STANDARD-CHAR}%
96 \index{CONDITION}%
97 \index{SERIOUS-CONDITION}%
98 \index{STORAGE-CONDITION}%
99 \index{SIMPLE-TYPE-ERROR}%
100 \index{TYPE-ERROR}%
101 \index{ERROR}%
102 \index{PROGRAM-ERROR}%
103 \index{CONTROL-ERROR}%
104 \index{PACKAGE-ERROR}%
105 \index{PRINT-NOT-READABLE}%
106 \index{STREAM-ERROR}%
107 \index{PARSE-ERROR}%
108 \index{CELL-ERROR}%
109 \index{FILE-ERROR}%
110 \index{ARITHMETIC-ERROR}%
111 \index{SIMPLE-CONDITION}%
112 \index{WARNING}%
113 \index{STYLE-WARNING}%
114 \index{SIMPLE-ERROR}%
115 \index{SIMPLE-WARNING}%
116 \index{UNDEFINED-FUNCTION}%
117 \index{UNBOUND-VARIABLE}%
118 \index{UNBOUND-SLOT}%
119 \index{END-OF-FILE}%
120 \index{READER-ERROR}%
121 \index{DIVISION-BY-ZERO}%
122 \index{FLOATING-POINT-INEXACT}%
123 \index{FLOATING-POINT-OVERFLOW}%
124 \index{FLOATING-POINT-UNDERFLOW}%
125 \index{FLOATING-POINT-INVALID-OPERATION}%
127 \end{figure}
129 For any class, there is always a corresponding type of the same name.
131 \begin{LIST}{1cm}
133 \IT{(\FU*{TYPEP} \VAR{foo} \VAR{type} \Op{\VAR{environment}\DF{\NIL}})}
135 Return \retval{\T} if \VAR{foo} is of \VAR{type}.
138 \IT{(\FU*{SUBTYPEP} \VAR{type-a} \VAR{type-b}
139 \Op{\VAR{environment}})}
141 Return \retval{\T} if \VAR{type-a} is a recognizable subtype of
142 \VAR{type-b}, and \retvalii{\NIL} if the relationship could not be
143 determined.
146 \IT{(\SO*{THE} \NEV{\VAR{type}} \VAR{form})}
148 Return \retval{values} of \VAR{form} which are declared to be of
149 \VAR{type}.
152 \IT{(\FU*{COERCE} \VAR{object} \VAR{type})}
154 Coerce \VAR{object} into \VAR{type}.
157 \IT{(\MC*{TYPECASE} \VAR{foo} \OPn{(\NEV{\VAR{type}} \PROGN{\VAR{a-form}})}
158 \OP{(\xorGOO{\kwd*{OTHERWISE}\\
159 \T}{\}} \PROGN{\VAR{b-form}\DF{\NIL}})})}
161 Return \retval{values of the \VAR{a-form}s} whose \VAR{type} is
162 \VAR{foo} of. Return \retval{values of \VAR{b-form}s} if no
163 \VAR{type} matches.
166 \IT{(\xorGOO{\MC*{CTYPECASE}\\
167 \MC*{ETYPECASE}}{\}} \VAR{foo} \OPn{(\NEV{\VAR{type}}
168 \PROGN{\VAR{form}})})}
170 Return \retval{values of the \VAR{form}s} whose \VAR{type} is
171 \VAR{foo} of. Signal correctable/non-correctable error, respectively
172 if no \VAR{type} matches.
175 \IT{(\FU*{TYPE-OF} \VAR{foo})}
177 \retval{Type of \VAR{foo}}.
180 \IT{(\MC*{CHECK-TYPE} \VAR{place} \VAR{type}
181 \Op{\VAR{string}\DF{\Goo{\LIT{a}\XOR\LIT{an}} \VAR{type}}})}
183 Signal correctable \kwd{type-error} if \VAR{place} is
184 not of \VAR{type}. Return \retval{\NIL}.
187 \IT{(\FU*{STREAM-ELEMENT-TYPE} \VAR{stream})}
189 Return \retval{type} of \VAR{stream} objects.
192 \IT{(\FU*{ARRAY-ELEMENT-TYPE} \VAR{array})}
194 Element \retval{type} \VAR{array} can hold.
197 \IT{(\FU*{UPGRADED-ARRAY-ELEMENT-TYPE} \VAR{type}
198 \Op{\VAR{environment}\DF{\NIL}})}
200 \retval{Element type} of most specialized array capable of holding
201 elements of \VAR{type}.
204 \IT{(\MC*{DEFTYPE} \VAR{foo} (\OPn{\VAR{macro-$\lambda$}})
205 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
206 \PROGN{\VAR{form}})}
208 Define type \retval{\VAR{foo}} which when referenced as (\VAR{foo}
209 \OPn{\NEV{\VAR{arg}}}) applies expanded \VAR{form}s to \VAR{arg}s
210 returning the new type. For (\OPn{\VAR{macro-$\lambda$}}) see
211 p.~\pageref{section:Macros} but with default value of \kwd{\A}
212 instead of \NIL. \VAR{form}s are enclosed in an implicit \SO{block} \VAR{foo}.
215 \IT{\arrGOO{(\kwd*{EQL } \VAR{foo})\\
216 (\kwd*{MEMBER } \OPn{\VAR{foo}})}{.}}
218 Specifier for a type comprising \VAR{foo} or \VAR{foo}s.
221 \IT{(\kwd*{SATISFIES} \VAR{predicate})}
223 Type specifier for all objects satisfying \VAR{predicate}.
226 \IT{(\kwd*{MOD} \VAR{n})}
228 Type specifier for all non-negative integers $<n$.
231 \IT{(\kwd*{NOT} \VAR{type})}
233 Complement of type.
236 \IT{(\kwd*{AND} \OPn{\VAR{type}}\DF{\T})}
238 Type specifier for intersection of \VAR{type}s.
241 \IT{(\kwd*{OR} \OPn{\VAR{type}}\DF{\NIL})}
243 Type specifier for union of \VAR{type}s.
246 \IT{(\kwd*{VALUES} \OPn{\VAR{type}} \OP{\OPn{\kwd{\&optional} \VAR{type}}
247 \Op{\kwd{\&rest} \VAR{other-args}}})}
249 Type specifier for multiple values.
252 \IT{\kwd{\A}}
254 \index{*@\A}%
255 As a type argument (cf.\ Figure \ref{data-types}): no restriction.
257 \end{LIST}
261 %%% Local Variables:
262 %%% mode: latex
263 %%% TeX-master: "clqr"
264 %%% End: