put a few fixme tags regarding implicit blocks
[clqr.git] / clqr-types-and-classes.tex
blob32f7d1094fe5dfb0efa8dd14cfd1d44e1f3618e2
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*{FIXNUM} \\
29 \kwd*{BIGNUM} \\
30 \kwd*{SIGNED-BYTE } \Op{\VAR{size}\DF{\kwd{\A}}}\\
31 \boxGOO{\kwd*{UNSIGNED-BYTE } \Op{\VAR{size}\DF{\kwd{\A}}}
32 \boxGOO{\kwd*{BIT} }}}\boxGOOcr
33 \kwd*{RATIO}}\boxGOOcr
34 \kwd*{FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
35 \boxGOO{%
36 \kwd*{SHORT-FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
37 \kwd*{SINGLE-FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
38 \kwd*{DOUBLE-FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}\\
39 \kwd*{LONG-FLOAT } \OP{\VAR{lower-limit}\DF{\kwd{\A}}\text{ }\Op{\VAR{upper-limit}\DF{\kwd{\A}}}}}}\boxGOOcr
40 \kwd*{COMPLEX } \Op{\VAR{type}\DF{\kwd{\A}}}}\boxGOOcr
41 \kwd*{SEQUENCE}
42 \boxGOO{%
43 \kwd*{LIST}
44 \boxGOO{%
45 \kwd*{CONS } \OP{\VAR{car-type}\DF{\kwd{\A}}\text{ }\Op{\VAR{cdr-type}\DF{\kwd{\A}}}}\\
46 \kwd*{SYMBOL}\footnotemark[2]
47 \boxGOO{
48 \kwd*{NULL}}}\boxGOOcr
49 \kwd*{ARRAY}\footnotemark[2] \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{dimension}\DF{\kwd{\A}}}}\\
50 \boxGOO{%
51 \kwd*{SIMPLE-ARRAY}\footnotemark[2] \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{dimension}\DF{\kwd{\A}}}}\\
52 \boxGOO{%
53 \kwd*{VECTOR}\footnotemark[2] \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{size}\DF{\kwd{\A}}}}\\
54 \boxGOO{%
55 \kwd*{BIT-VECTOR}\footnotemark[2] \Op{\VAR{size}\DF{\kwd{\A}}}\\
56 \boxGOO{%
57 \kwd*{SIMPLE-BIT-VECTOR } \Op{\VAR{size}\DF{\kwd{\A}}}}\boxGOOcr
58 \kwd*{STRING}\footnotemark[2] \Op{\VAR{size}\DF{\kwd{\A}}}\\
59 \boxGOO{%
60 \kwd*{SIMPLE-STRING } \Op{\VAR{size}\DF{\kwd{\A}}}\\
61 \boxGOO{%
62 \kwd*{BASE-STRING}\footnotemark[2] \Op{\VAR{size}\DF{\kwd{\A}}}\\
63 \boxGOO{%
64 \kwd*{SIMPLE-BASE-STRING } \Op{\VAR{size}\DF{\kwd{\A}}}}}}\boxGOOcr
65 \kwd*{SIMPLE-VECTOR } \Op{\VAR{size}\DF{\kwd{\A}}}}}\boxGOOcr
66 \kwd*{VECTOR} \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{size}\DF{\kwd{\A}}}}\\
67 \boxGOO{%
68 \kwd*{STRING} \Op{\VAR{size}\DF{\kwd{\A}}}
69 \boxGOO{%
70 \kwd*{BASE-STRING} \Op{\VAR{size}\DF{\kwd{\A}}}}\boxGOOcr
71 \kwd*{BIT-VECTOR} \Op{\VAR{size}\DF{\kwd{\A}}}}}}\boxGOOcr
72 \kwd*{ARRAY} \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{dimension}\DF{\kwd{\A}}}}\\
73 \boxGOO{%
74 \kwd*{SIMPLE-ARRAY} \OP{\VAR{type}\DF{\kwd{\A}}\text{ }\Op{\VAR{dimension}\DF{\kwd{\A}}}}}\boxGOOcr
75 \kwd*{CHARACTER}
76 \boxGOO{%
77 \kwd*{BASE-CHAR}
78 \boxGOO{%
79 \kwd*{STANDARD-CHAR}}\boxGOOcr
80 \kwd*{EXTENDED-CHAR}}\boxGOOcr
81 \kwd*{STREAM}
82 \boxGOO{%
83 \kwd*{FILE-STREAM},\>
84 \kwd*{TWO-WAY-STREAM},\>
85 \kwd*{SYNONYM-STREAM},\\
86 \kwd*{STRING-STREAM},\>
87 \kwd*{BROADCAST-STREAM},\>
88 \kwd*{ECHO-STREAM}\\
89 \kwd*{CONCATENATED-STREAM}}\boxGOOcr
90 \kwd*{PATHNAME}
91 \boxGOO{%
92 \kwd*{LOGICAL-PATHNAME}}\boxGOOcr
93 \kwd*{SYMBOL}
94 \boxGOO{%
95 \kwd*{KEYWORD},\>
96 \kwd*{BOOLEAN}}\boxGOOcr
97 \kwd*{FUNCTION } \OP{\VAR{arg-types }\Op{\VAR{value-types}}}\\
98 \boxGOO{%
99 \kwd*{GENERIC-FUNCTION}
100 \boxGOO{\kwd*{STANDARD-GENERIC-FUNCTION}}\boxGOOcr
101 \kwd*{COMPILED-FUNCTION}}\boxGOOcr
102 \kwd*{STANDARD-OBJECT}
103 \boxGOO{%
104 \kwd*{CLASS}
105 \boxGOO{%
106 \kwd*{STANDARD-CLASS},\>
107 \kwd*{BUILT-IN-CLASS},\\
108 \kwd*{STRUCTURE-CLASS}}\boxGOOcr
109 \kwd*{STANDARD-METHOD}}\boxGOOcr
110 \kwd*{ATOM},\>
111 \kwd*{HASH-TABLE},\>
112 \kwd*{STRUCTURE-OBJECT},\>
113 \kwd*{PACKAGE},\>
114 \kwd*{READTABLE},\\
115 \kwd*{RANDOM-STATE},\>
116 \kwd*{RESTART},\>
117 \kwd*{METHOD},\>
118 \kwd*{METHOD-COMBINATION}}}
119 \end{center}\vspace{-1em}
120 {\footnotesize\footnotemark[2]For supertypes of this
121 type look for the instance without a \footnotemark[2].}\\
122 {\footnotesize As a type argument, \kwd*{\A} means no restriction.}
124 \caption{Data Types.}%
125 \end{figure}
128 \begin{LIST}{1cm}
130 \IT{(\FU*{TYPEP} \VAR{foo} \VAR{type} \Op{\VAR{environment}})}
132 Return \retval{\T} if \VAR{foo} is of \VAR{type}.
135 \IT{(\FU*{SUBTYPEP} \VAR{type-a} \VAR{type-b}
136 \Op{\VAR{environment}})}
138 Return \retval{\T} if \VAR{type-a} is a recognizable subtype of
139 \VAR{type-b}, and \retvalii{\NIL} if the relationship could not be
140 determined.
143 \IT{(\SO*{THE} \NEV{\VAR{type}} \VAR{form})}
145 Return \retval{values} of \VAR{form} which are declared to be of
146 \VAR{type}.
149 \IT{(\FU*{COERCE} \VAR{object} \VAR{type})}
151 Coerce \VAR{object} into \VAR{type}.
154 \IT{(\MC*{TYPECASE} \VAR{foo} \OPn{(\NEV{\VAR{type}} \PROGN{\VAR{a-form}})}
155 \OP{(\xorGOO{\kwd*{OTHERWISE}\\
156 \T}{\}} \PROGN{\VAR{b-form}\DF{\NIL}})})}
158 Return \retval{values of the \VAR{a-form}s} whose \VAR{type} is
159 \VAR{foo} of. Return \retval{values of \VAR{b-form}s} if no
160 \VAR{type} matches.
163 \IT{(\xorGOO{\MC*{CTYPECASE}\\
164 \MC*{ETYPECASE}}{\}} \VAR{foo} \OPn{(\NEV{\VAR{type}}
165 \PROGN{\VAR{form}\DF{\NIL}})})}
167 Return \retval{values of the \VAR{form}s} whose \VAR{type} is
168 \VAR{foo} of. Signal correctable/non-correctable error, respectively
169 if no \VAR{type} matches.
172 \IT{(\FU*{TYPE-OF} \VAR{foo})}
174 \retval{Type of \VAR{foo}}.
177 \IT{(\kwd*{CHECK-TYPE} \VAR{place} \VAR{type} \Op{\VAR{string}})}
179 Return \retval{\NIL} and signal correctable error if \VAR{place} is
180 not of \VAR{type}.
183 \IT{(\FU*{STREAM-ELEMENT-TYPE} \VAR{stream})}
185 Return \retval{type} of \VAR{stream} objects.
188 \IT{(\FU*{ARRAY-ELEMENT-TYPE} \VAR{array})}
190 Element \retval{type} \VAR{array} holds.
193 \IT{(\FU*{UPGRADED-ARRAY-ELEMENT-TYPE} \VAR{type}
194 \Op{\VAR{environment}})}
196 \retval{Element type} of most specialized array capable of holding
197 elements of \VAR{type}.
200 \IT{(\MC*{DEFTYPE} \VAR{foo} (\OPn{\VAR{macro-$\lambda$}}) %FIXME:BLOCK
201 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
202 \PROGN{\VAR{form}})}
204 Define type \retval{\VAR{foo}} which when referenced by (\VAR{foo}
205 \OPn{\NEV{\VAR{arg}}}) applies expanded \VAR{form}s to \VAR{arg}s
206 returning the new type. For (\OPn{\VAR{macro-$\lambda$}}) see
207 p.~\pageref{section:Macros} but with the default value of \VAR{init}
208 being \kwd{\A} instead of \NIL.
211 \IT{\arrGOO{(\kwd{EQL } \VAR{foo})\\
212 (\kwd{MEMBER } \OPn{\VAR{foo}})}{.}}
214 Specifier for a type comprising \VAR{foo} or \VAR{foo}s.
217 \IT{(\kwd*{SATISFIES} \VAR{name})}
219 Type specifier for all objects satisfying predicate \VAR{name}.
222 \IT{(\kwd*{MOD} \VAR{n})}
224 Type specifier for all integers $<n$.
227 \IT{(\kwd{NOT} \VAR{type})}
229 Complement of type.
232 \IT{(\kwd*{AND} \OPn{\VAR{type}}\DF{\T})}
234 Type specifier for intersection of \VAR{type}s.
237 \IT{(\kwd*{OR} \OPn{\VAR{type}}\DF{\NIL})}
239 Type specifier for union of \VAR{type}s.
242 \IT{(\kwd*{VALUES} \OPn{\VAR{type}} \OP{\OPn{\VAR{type}}
243 \Op{\VAR{other-args}}})}
245 Type specifier for multiple values.
248 \end{LIST}