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