Fix sample images on web page
[clqr.git] / clqr-types-and-classes.tex
blobb14ec4bbd5e2b6cc33b364f629662cedcc2b7c7b
1 % Copyright (C) 2008, 2009, 2010, 2011, 2012 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 Every type is also a supertype of \NIL, the empty type.
27 \label{data-types}%
29 \index{*@\A}%
30 \index{T}%
31 \index{ATOM}%
32 \index{READTABLE}%
33 \index{PACKAGE}%
34 \index{SYMBOL}%
35 \index{KEYWORD}%
36 \index{BOOLEAN}%
37 \index{RESTART}%
38 \index{RANDOM-STATE}%
39 \index{HASH-TABLE}%
40 \index{STRUCTURE-OBJECT}%
41 \index{STANDARD-OBJECT}%
42 \index{NULL}%
43 \index{CLASS}%
44 \index{BUILT-IN-CLASS}%
45 \index{STANDARD-CLASS}%
46 \index{STRUCTURE-CLASS}%
47 \index{METHOD}%
48 \index{STANDARD-METHOD}%
49 \index{METHOD-COMBINATION}%
50 \index{CHARACTER}%
51 \index{FUNCTION}%
52 \index{COMPILED-FUNCTION}%
53 \index{GENERIC-FUNCTION}%
54 \index{STANDARD-GENERIC-FUNCTION}%
55 \index{PATHNAME}%
56 \index{LOGICAL-PATHNAME}%
57 \index{NUMBER}%
58 \index{COMPLEX}%
59 \index{REAL}%
60 \index{FLOAT}%
61 \index{SHORT-FLOAT}%
62 \index{SINGLE-FLOAT}%
63 \index{DOUBLE-FLOAT}%
64 \index{LONG-FLOAT}%
65 \index{RATIONAL}%
66 \index{INTEGER}%
67 \index{RATIO}%
68 \index{SIGNED-BYTE}%
69 \index{FIXNUM}%
70 \index{BIGNUM}%
71 \index{UNSIGNED-BYTE}%
72 \index{BIT}%
73 \index{LIST}%
74 \index{SEQUENCE}%
75 \index{CONS}%
76 \index{ARRAY}%
77 \index{SIMPLE-ARRAY}%
78 \index{VECTOR}%
79 \index{STRING}%
80 \index{SIMPLE-STRING}%
81 \index{BASE-STRING}%
82 \index{SIMPLE-BASE-STRING}%
83 \index{SIMPLE-VECTOR}%
84 \index{BIT-VECTOR}%
85 \index{SIMPLE-BIT-VECTOR}%
86 \index{STREAM}%
87 \index{FILE-STREAM}%
88 \index{TWO-WAY-STREAM}%
89 \index{SYNONYM-STREAM}%
90 \index{STRING-STREAM}%
91 \index{BROADCAST-STREAM}%
92 \index{CONCATENATED-STREAM}%
93 \index{ECHO-STREAM}%
94 \index{EXTENDED-CHAR}%
95 \index{BASE-CHAR}%
96 \index{STANDARD-CHAR}%
97 \index{CONDITION}%
98 \index{SERIOUS-CONDITION}%
99 \index{STORAGE-CONDITION}%
100 \index{SIMPLE-TYPE-ERROR}%
101 \index{TYPE-ERROR}%
102 \index{ERROR}%
103 \index{PROGRAM-ERROR}%
104 \index{CONTROL-ERROR}%
105 \index{PACKAGE-ERROR}%
106 \index{PRINT-NOT-READABLE}%
107 \index{STREAM-ERROR}%
108 \index{PARSE-ERROR}%
109 \index{CELL-ERROR}%
110 \index{FILE-ERROR}%
111 \index{ARITHMETIC-ERROR}%
112 \index{SIMPLE-CONDITION}%
113 \index{WARNING}%
114 \index{STYLE-WARNING}%
115 \index{SIMPLE-ERROR}%
116 \index{SIMPLE-WARNING}%
117 \index{UNDEFINED-FUNCTION}%
118 \index{UNBOUND-VARIABLE}%
119 \index{UNBOUND-SLOT}%
120 \index{END-OF-FILE}%
121 \index{READER-ERROR}%
122 \index{DIVISION-BY-ZERO}%
123 \index{FLOATING-POINT-INEXACT}%
124 \index{FLOATING-POINT-OVERFLOW}%
125 \index{FLOATING-POINT-UNDERFLOW}%
126 \index{FLOATING-POINT-INVALID-OPERATION}%
128 \end{figure}
130 For any class, there is always a corresponding type of the same name.
132 \begin{LIST}{1cm}
134 \IT{(\FU*{TYPEP} \VAR{foo} \VAR{type} \Op{\VAR{environment}\DF{\NIL}})}
136 \retval{\T} if \VAR{foo} is of \VAR{type}.
139 \IT{(\FU*{SUBTYPEP} \VAR{type-a} \VAR{type-b}
140 \Op{\VAR{environment}})}
142 Return \retval{\T} if \VAR{type-a} is a recognizable subtype of
143 \VAR{type-b}, and \retvalii{\NIL} if the relationship could not be
144 determined.
147 \IT{(\SO*{THE} \NEV{\VAR{type}} \VAR{form})}
149 Declare \retval{values of \VAR{form}} to be of
150 \VAR{type}.
153 \IT{(\FU*{COERCE} \VAR{object} \VAR{type})}
155 Coerce \retval{\VAR{object}} into \VAR{type}.
158 \IT{(\MC*{TYPECASE} \VAR{foo} \OPn{(\NEV{\VAR{type}} \PROGN{\VAR{a-form}})}
159 \OP{(\xorGOO{\kwd*{OTHERWISE}\\
160 \T}{\}} \PROGN{\VAR{b-form}\DF{\NIL}})})}
162 Return \retval{values of the \VAR{a-form}s} whose \VAR{type} is
163 \VAR{foo} of. Return \retval{values of \VAR{b-form}s} if no
164 \VAR{type} matches.
167 \IT{(\xorGOO{%
168 \MC*{ETYPECASE}\\
169 \MC*{CTYPECASE}}{\}}
170 \VAR{foo}
171 \OPn{(\NEV{\VAR{type}} \PROGN{\VAR{form}})})}
173 Return \retval{values} of the first \OPn{\VAR{form}} whose \VAR{type} is
174 \VAR{foo} of. Signal non-correctable/correctable \kwd{type-error}
175 if no \VAR{type} matches.
178 \IT{(\FU*{TYPE-OF} \VAR{foo})}
180 \retval{Type of \VAR{foo}}.
183 \IT{(\MC*{CHECK-TYPE} \VAR{place} \VAR{type}
184 \Op{\VAR{string}\DF{\Goo{\LIT{a}\XOR\LIT{an}}\hspace{.3ex}\VAR{type}}})}
186 Signal correctable \kwd{type-error} if \VAR{place} is
187 not of \VAR{type}. Return \retval{\NIL}.
190 \IT{(\FU*{STREAM-ELEMENT-TYPE} \VAR{stream})}
192 \retval{Type} of \VAR{stream} objects.
195 \IT{(\FU*{ARRAY-ELEMENT-TYPE} \VAR{array})}
197 Element \retval{type} \VAR{array} can hold.
200 \IT{(\FU*{UPGRADED-ARRAY-ELEMENT-TYPE} \VAR{type}
201 \Op{\VAR{environment}\DF{\NIL}})}
203 \retval{Element type} of most specialized array capable of holding
204 elements of \VAR{type}.
207 \IT{(\MC*{DEFTYPE} \VAR{foo} (\OPn{\VAR{macro-$\lambda$}})
208 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
209 \PROGN{\VAR{form}})}
211 Define type \retval{\VAR{foo}} which when referenced as (\VAR{foo}
212 \OPn{\NEV{\VAR{arg}}}) (or as \VAR{foo} if \VAR{macro-$\lambda$}
213 doesn't contain any required parameters) applies expanded \VAR{form}s to \VAR{arg}s
214 returning the new type. For (\OPn{\VAR{macro-$\lambda$}}) see
215 page \pageref{section:Macros} but with default value of \kwd{\A}
216 instead of \NIL. \VAR{form}s are enclosed in an implicit \SO{block}
217 named \VAR{foo}.
220 \IT{\arrGOO{(\kwd*{EQL } \VAR{foo})\\
221 (\kwd*{MEMBER } \OPn{\VAR{foo}})}{.}}
223 Specifier for a type comprising \VAR{foo} or \VAR{foo}s.
226 \IT{(\kwd*{SATISFIES} \VAR{predicate})}
228 Type specifier for all objects satisfying \VAR{predicate}.
231 \IT{(\kwd*{MOD} \VAR{n})}
233 Type specifier for all non-negative integers $<n$.
236 \IT{(\kwd*{NOT} \VAR{type})}
238 Complement of type.
241 \IT{(\kwd*{AND} \OPn{\VAR{type}}\DF{\T})}
243 Type specifier for intersection of \VAR{type}s.
246 \IT{(\kwd*{OR} \OPn{\VAR{type}}\DF{\NIL})}
248 Type specifier for union of \VAR{type}s.
251 \IT{(\kwd*{VALUES} \OPn{\VAR{type}} \OP{\OPn{\kwd{\&optional} \VAR{type}}
252 \Op{\kwd{\&rest} \VAR{other-args}}})}
254 Type specifier for multiple values.
257 \IT{\kwd{\A}}
259 \index{*@\A}%
260 As a type argument (cf.\ Figure \ref{data-types}): no restriction.
262 \end{LIST}
266 %%% Local Variables:
267 %%% mode: latex
268 %%% TeX-master: "clqr"
269 %%% End: