Unfinished work on figure Data Types.
[clqr.git] / clqr-types-and-classes.tex
blobad7935df65cee599ae0e779b6a0c6fa444c8f2da
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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 \begin{figure}
16 \begin{center}
17 \begin{sideways}
18 %%% \boxGOO{%
19 %%% \T\index{T}%
20 %%% \boxGOO{%
21 %%% \kwd*{NUMBER}
22 %%% \boxGOO{%
23 %%% \kwd*{REAL } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
24 %%% \boxGOO{%
25 %%% \kwd*{RATIONAL } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
26 %%% \boxGOO{%
27 %%% \kwd*{INTEGER } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
28 %%% \boxGOO{%
29 %%% \kwd*{SIGNED-BYTE } \Op{\VAR{size}\DF{\kwd{\A}}}\\
30 %%% \boxGOO{\kwd*{UNSIGNED-BYTE } \Op{\VAR{size}\DF{\kwd{\A}}}
31 %%% \boxGOO{\kwd*{BIT} }}\boxGOOcr
32 %%% \kwd*{FIXNUM} ;\>
33 %%% \kwd*{BIGNUM}
34 %%% }\boxGOOcr
35 %%% \kwd*{RATIO}}\boxGOOcr
36 %%% \kwd*{FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
37 %%% \boxGOO{%
38 %%% \kwd*{SHORT-FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
39 %%% \kwd*{SINGLE-FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
40 %%% \kwd*{DOUBLE-FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
41 %%% \kwd*{LONG-FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}}}\boxGOOcr
42 %%% \kwd*{COMPLEX } \Op{\VAR{type}\DF{\kwd{\A}}}}\boxGOOcr
43 %%% \kwd*{SEQUENCE}
44 %%% \boxGOO{%
45 %%% \kwd*{LIST}
46 %%% \boxGOO{%
47 %%% \kwd*{CONS } \OP{\VAR{car-type}\DF{\kwd{\A}}\text{ }\Op{\VAR{cdr-type}\DF{\kwd{\A}}}}\\
48 %%% \kwd*{SYMBOL}\footnotemark[2]
49 %%% \boxGOO{
50 %%% \kwd*{NULL}}}\boxGOOcr
51 %%% \kwd*{ARRAY}\footnotemark[2] \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{rank}\DF{\kwd{\A}}\XOR(\OPn{\VAR{dimension}})}}\\
52 %%% \boxGOO{%
53 %%% \kwd*{SIMPLE-ARRAY}\footnotemark[2] \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{rank}\DF{\kwd{\A}}\XOR(\OPn{\VAR{dimension}})}}\\
54 %%% \boxGOO{%
55 %%% \kwd*{VECTOR}\footnotemark[2] \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{size}\DF{\kwd{\A}}}}\\
56 %%% \boxGOO{%
57 %%% \kwd*{BIT-VECTOR}\footnotemark[2] \Op{\VAR{size}\DF{\kwd{\A}}}\\
58 %%% \boxGOO{%
59 %%% \kwd*{SIMPLE-BIT-VECTOR } \Op{\VAR{size}\DF{\kwd{\A}}}}\boxGOOcr
60 %%% \kwd*{STRING}\footnotemark[2] \Op{\VAR{size}\DF{\kwd{\A}}}\\
61 %%% \boxGOO{%
62 %%% \kwd*{SIMPLE-STRING } \Op{\VAR{size}\DF{\kwd{\A}}}\\
63 %%% \boxGOO{%
64 %%% \kwd*{BASE-STRING}\footnotemark[2] \Op{\VAR{size}\DF{\kwd{\A}}}\\
65 %%% \boxGOO{%
66 %%% \kwd*{SIMPLE-BASE-STRING } \Op{\VAR{size}\DF{\kwd{\A}}}}}}\boxGOOcr
67 %%% \kwd*{SIMPLE-VECTOR } \Op{\VAR{size}\DF{\kwd{\A}}}}}\boxGOOcr
68 %%% \kwd*{VECTOR } \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{size}\DF{\kwd{\A}}}}\\
69 %%% \boxGOO{%
70 %%% \kwd*{STRING } \Op{\VAR{size}\DF{\kwd{\A}}}
71 %%% \boxGOO{%
72 %%% \kwd*{BASE-STRING } \Op{\VAR{size}\DF{\kwd{\A}}}}\boxGOOcr
73 %%% \kwd*{BIT-VECTOR } \Op{\VAR{size}\DF{\kwd{\A}}}}}}\boxGOOcr
74 %%% \kwd*{ARRAY} \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{rank}\DF{\kwd{\A}}\XOR(\OPn{\VAR{dimension}})}}\\
75 %%% \boxGOO{%
76 %%% \kwd*{SIMPLE-ARRAY} \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{rank}\DF{\kwd{\A}}\XOR(\OPn{\VAR{dimension}})}}
77 %%% }\boxGOOcr
78 %%% \kwd*{CHARACTER}
79 %%% \boxGOO{%
80 %%% \kwd*{BASE-CHAR}
81 %%% \boxGOO{%
82 %%% \kwd*{STANDARD-CHAR}}\boxGOOcr
83 %%% \kwd*{EXTENDED-CHAR}}\boxGOOcr
84 %%% \kwd*{STREAM}
85 %%% \boxGOO{%
86 %%% \kwd*{FILE-STREAM};\>
87 %%% \kwd*{TWO-WAY-STREAM};\>
88 %%% \kwd*{SYNONYM-STREAM};\\
89 %%% \kwd*{STRING-STREAM};\>
90 %%% \kwd*{BROADCAST-STREAM};\>
91 %%% \kwd*{ECHO-STREAM};\\
92 %%% \kwd*{CONCATENATED-STREAM}}\boxGOOcr
93 %%% \kwd*{PATHNAME}
94 %%% \boxGOO{%
95 %%% \kwd*{LOGICAL-PATHNAME}}\boxGOOcr
96 %%% \kwd*{SYMBOL}
97 %%% \boxGOO{%
98 %%% \kwd*{KEYWORD};\>
99 %%% \kwd*{BOOLEAN}}\boxGOOcr
100 %%% \kwd*{FUNCTION } \OP{\VAR{arg-types }\Op{\VAR{value-types}}}\\
101 %%% \boxGOO{%
102 %%% \kwd*{GENERIC-FUNCTION}
103 %%% \boxGOO{\kwd*{STANDARD-GENERIC-FUNCTION}}\boxGOOcr
104 %%% \kwd*{COMPILED-FUNCTION}}\boxGOOcr
105 %%% \kwd*{STANDARD-OBJECT}
106 %%% \boxGOO{%
107 %%% \kwd*{CLASS}
108 %%% \boxGOO{%
109 %%% \kwd*{STANDARD-CLASS};\>
110 %%% \kwd*{BUILT-IN-CLASS};\\
111 %%% \kwd*{STRUCTURE-CLASS}}\boxGOOcr
112 %%% \kwd*{METHOD}\footnotemark[2]
113 %%% \boxGOO{%
114 %%% \kwd*{STANDARD-METHOD}}}\boxGOOcr
115 %%% \kwd*{ATOM};\>
116 %%% \kwd*{HASH-TABLE};\>
117 %%% \kwd*{STRUCTURE-OBJECT};\>
118 %%% \kwd*{PACKAGE};\>
119 %%% \kwd*{READTABLE};\\
120 %%% \kwd*{RANDOM-STATE};\>
121 %%% \kwd*{RESTART};\>
122 %%% \kwd*{METHOD};\>
123 %%% \kwd*{METHOD-COMBINATION}}}
124 \includegraphics{clqr-types-and-classes.1}
125 \end{sideways}
126 \end{center}
127 %%% {\footnotesize\footnotemark[2]For supertypes of this
128 %%% type look for the instance without a \footnotemark[2].}\\
129 %%% {\footnotesize As a type argument, \kwd{\A} means no restriction.\index{*@\A}}
131 \caption{Data Types.}%
132 \end{figure}
134 For any class, there is always a corresponding type of the same name.
136 \begin{LIST}{1cm}
138 \IT{(\FU*{TYPEP} \VAR{foo} \VAR{type} \Op{\VAR{environment}\DF{\NIL}})}
140 Return \retval{\T} if \VAR{foo} is of \VAR{type}.
143 \IT{(\FU*{SUBTYPEP} \VAR{type-a} \VAR{type-b}
144 \Op{\VAR{environment}})}
146 Return \retval{\T} if \VAR{type-a} is a recognizable subtype of
147 \VAR{type-b}, and \retvalii{\NIL} if the relationship could not be
148 determined.
151 \IT{(\SO*{THE} \NEV{\VAR{type}} \VAR{form})}
153 Return \retval{values} of \VAR{form} which are declared to be of
154 \VAR{type}.
157 \IT{(\FU*{COERCE} \VAR{object} \VAR{type})}
159 Coerce \VAR{object} into \VAR{type}.
162 \IT{(\MC*{TYPECASE} \VAR{foo} \OPn{(\NEV{\VAR{type}} \PROGN{\VAR{a-form}})}
163 \OP{(\xorGOO{\kwd*{OTHERWISE}\\
164 \T}{\}} \PROGN{\VAR{b-form}\DF{\NIL}})})}
166 Return \retval{values of the \VAR{a-form}s} whose \VAR{type} is
167 \VAR{foo} of. Return \retval{values of \VAR{b-form}s} if no
168 \VAR{type} matches.
171 \IT{(\xorGOO{\MC*{CTYPECASE}\\
172 \MC*{ETYPECASE}}{\}} \VAR{foo} \OPn{(\NEV{\VAR{type}}
173 \PROGN{\VAR{form}})})}
175 Return \retval{values of the \VAR{form}s} whose \VAR{type} is
176 \VAR{foo} of. Signal correctable/non-correctable error, respectively
177 if no \VAR{type} matches.
180 \IT{(\FU*{TYPE-OF} \VAR{foo})}
182 \retval{Type of \VAR{foo}}.
185 \IT{(\kwd*{CHECK-TYPE} \VAR{place} \VAR{type} \Op{\VAR{string}})}
187 Return \retval{\NIL} and signal correctable \kwd{type-error} if \VAR{place} is
188 not of \VAR{type}.
191 \IT{(\FU*{STREAM-ELEMENT-TYPE} \VAR{stream})}
193 Return \retval{type} of \VAR{stream} objects.
196 \IT{(\FU*{ARRAY-ELEMENT-TYPE} \VAR{array})}
198 Element \retval{type} \VAR{array} can hold.
201 \IT{(\FU*{UPGRADED-ARRAY-ELEMENT-TYPE} \VAR{type}
202 \Op{\VAR{environment}\DF{\NIL}})}
204 \retval{Element type} of most specialized array capable of holding
205 elements of \VAR{type}.
208 \IT{(\MC*{DEFTYPE} \VAR{foo} (\OPn{\VAR{macro-$\lambda$}})
209 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
210 \PROGN{\VAR{form}})}
212 Define type \retval{\VAR{foo}} which when referenced as (\VAR{foo}
213 \OPn{\NEV{\VAR{arg}}}) applies expanded \VAR{form}s to \VAR{arg}s
214 returning the new type. For (\OPn{\VAR{macro-$\lambda$}}) see
215 p.~\pageref{section:Macros} but with default value of \kwd{\A}
216 instead of \NIL. \VAR{form}s are enclosed in an implicit \SO{block} \VAR{foo}.
219 \IT{\arrGOO{(\kwd*{EQL } \VAR{foo})\\
220 (\kwd*{MEMBER } \OPn{\VAR{foo}})}{.}}
222 Specifier for a type comprising \VAR{foo} or \VAR{foo}s.
225 \IT{(\kwd*{SATISFIES} \VAR{predicate})}
227 Type specifier for all objects satisfying \VAR{predicate}.
230 \IT{(\kwd*{MOD} \VAR{n})}
232 Type specifier for all non-negative integers $<n$.
235 \IT{(\kwd*{NOT} \VAR{type})}
237 Complement of type.
240 \IT{(\kwd*{AND} \OPn{\VAR{type}}\DF{\T})}
242 Type specifier for intersection of \VAR{type}s.
245 \IT{(\kwd*{OR} \OPn{\VAR{type}}\DF{\NIL})}
247 Type specifier for union of \VAR{type}s.
250 \IT{(\kwd*{VALUES} \OPn{\VAR{type}} \OP{\OPn{\kwd{\&optional} \VAR{type}}
251 \Op{\kwd{\&rest} \VAR{other-args}}})}
253 Type specifier for multiple values.
256 \end{LIST}
260 %%% Local Variables:
261 %%% mode: latex
262 %%% TeX-master: "clqr"
263 %%% End: