1 % Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014, 2018
4 % Permission is granted to copy, distribute and/or modify this
5 % document under the terms of the GNU Free Documentation License,
6 % Version 1.2 or any later version published by the Free Software
7 % Foundation; with no Invariant Sections, no Front-Cover Texts and
8 % no Back-Cover Texts. For details see file COPYING.
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{Types and Classes
}
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18 \includegraphics{clqr-types-and-classes
.1}
21 \caption[]{Precedence Order of System Classes
22 (
\includegraphics{clqr-types-and-classes
.3}),
23 Classes (
\includegraphics{clqr-types-and-classes
.4}),
24 Types (
\includegraphics{clqr-types-and-classes
.2}), and
26 (
\includegraphics{clqr-types-and-classes
.5}).\\
27 Every type is also a supertype of
\NIL, the empty type.
41 \index{STRUCTURE-OBJECT
}%
42 \index{STANDARD-OBJECT
}%
45 \index{BUILT-IN-CLASS
}%
46 \index{STANDARD-CLASS
}%
47 \index{STRUCTURE-CLASS
}%
49 \index{STANDARD-METHOD
}%
50 \index{METHOD-COMBINATION
}%
53 \index{COMPILED-FUNCTION
}%
54 \index{GENERIC-FUNCTION
}%
55 \index{STANDARD-GENERIC-FUNCTION
}%
57 \index{LOGICAL-PATHNAME
}%
72 \index{UNSIGNED-BYTE
}%
81 \index{SIMPLE-STRING
}%
83 \index{SIMPLE-BASE-STRING
}%
84 \index{SIMPLE-VECTOR
}%
86 \index{SIMPLE-BIT-VECTOR
}%
89 \index{TWO-WAY-STREAM
}%
90 \index{SYNONYM-STREAM
}%
91 \index{STRING-STREAM
}%
92 \index{BROADCAST-STREAM
}%
93 \index{CONCATENATED-STREAM
}%
95 \index{EXTENDED-CHAR
}%
97 \index{STANDARD-CHAR
}%
99 \index{SERIOUS-CONDITION
}%
100 \index{STORAGE-CONDITION
}%
101 \index{SIMPLE-TYPE-ERROR
}%
104 \index{PROGRAM-ERROR
}%
105 \index{CONTROL-ERROR
}%
106 \index{PACKAGE-ERROR
}%
107 \index{PRINT-NOT-READABLE
}%
108 \index{STREAM-ERROR
}%
112 \index{ARITHMETIC-ERROR
}%
113 \index{SIMPLE-CONDITION
}%
115 \index{STYLE-WARNING
}%
116 \index{SIMPLE-ERROR
}%
117 \index{SIMPLE-WARNING
}%
118 \index{UNDEFINED-FUNCTION
}%
119 \index{UNBOUND-VARIABLE
}%
120 \index{UNBOUND-SLOT
}%
122 \index{READER-ERROR
}%
123 \index{DIVISION-BY-ZERO
}%
124 \index{FLOATING-POINT-INEXACT
}%
125 \index{FLOATING-POINT-OVERFLOW
}%
126 \index{FLOATING-POINT-UNDERFLOW
}%
127 \index{FLOATING-POINT-INVALID-OPERATION
}%
131 For any class, there is always a corresponding type of the same name.
135 \IT{(
\FU*
{TYPEP
} \VAR{foo
} \VAR{type
} \Op{\VAR{environment
}\DF{\NIL}})
}
137 \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
148 \IT{(
\SO*
{THE
} \NEV{\VAR{type
}} \VAR{form
})
}
150 Declare
\retval{values of
\VAR{form
}} to be of
154 \IT{(
\FU*
{COERCE
} \VAR{object
} \VAR{type
})
}
156 Coerce
\retval{\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 first
\OPn{\VAR{a-form
}}} whose
\VAR{type
} is
164 \VAR{foo
} of. Return
\retval{values of
\VAR{b-form
}s
} if no
166 % Keep \OPn{\VAR{a-form}} instead of the otherwise preferable
167 % \VAR{a-form}s because we're talking about one set of a-forms out
175 \OPn{(
\NEV{\VAR{type
}} \PROGN{\VAR{form
}})
})
}
177 Return
\retval{values of the first
\OPn{\VAR{form
}}} whose
\VAR{type
} is
178 \VAR{foo
} of. Signal non-correctable/correctable
\kwd{type-error
}
179 if no
\VAR{type
} matches.
180 % Keep \OPn{\VAR{form}} instead of the otherwise preferable
181 % \VAR{form}s because we're talking about one set of forms out
185 \IT{(
\FU*
{TYPE-OF
} \VAR{foo
})
}
187 \retval{Type of
\VAR{foo
}}.
190 \IT{(
\MC*
{CHECK-TYPE
} \VAR{place
} \VAR{type
}
191 \Op{\VAR{string
}\DF{\Goo{\LIT{a
}\XOR\LIT{an
}}\hspace{.3ex
}\VAR{type
}}})
}
193 Signal correctable
\kwd{type-error
} if
\VAR{place
} is
194 not of
\VAR{type
}. Return
\retval{\NIL}.
197 \IT{(
\FU*
{STREAM-ELEMENT-TYPE
} \VAR{stream
})
}
199 \retval{Type
} of
\VAR{stream
} objects.
202 \IT{(
\FU*
{ARRAY-ELEMENT-TYPE
} \VAR{array
})
}
204 Element
\retval{type
} \VAR{array
} can hold.
207 \IT{(
\FU*
{UPGRADED-ARRAY-ELEMENT-TYPE
} \VAR{type
}
208 \Op{\VAR{environment
}\DF{\NIL}})
}
210 \retval{Element type
} of most specialized array capable of holding
211 elements of
\VAR{type
}.
214 \IT{(
\MC*
{DEFTYPE
} \VAR{foo
} (
\OPn{\VAR{macro-$
\lambda$
}})
216 \OPn{(
\kwd{declare
} \OPn{\NEV{\VAR{decl
}}})
}\\
220 Define type
\retval{\VAR{foo
}} which when referenced as (
\VAR{foo
}
221 \OPn{\NEV{\VAR{arg
}}}) (or as
\VAR{foo
} if
\VAR{macro-$
\lambda$
}
222 doesn't contain any required parameters) applies expanded
\VAR{form
}s to
\VAR{arg
}s
223 returning the new type. For (
\OPn{\VAR{macro-$
\lambda$
}}) see
224 page
\pageref{section:Macros
} but with default value of
\kwd{\A}
225 instead of
\NIL.
\VAR{form
}s are enclosed in an implicit
\SO{block
}
229 \IT{\arrGOO{(
\kwd*
{EQL
} \VAR{foo
})\\
230 (
\kwd*
{MEMBER
} \OPn{\VAR{foo
}})
}{.
}}
232 Specifier for a type comprising
\VAR{foo
} or
\VAR{foo
}s.
235 \IT{(
\kwd*
{SATISFIES
} \VAR{predicate
})
}
237 Type specifier for all objects satisfying
\VAR{predicate
}.
240 \IT{(
\kwd*
{MOD
} \VAR{n
})
}
242 Type specifier for all non-negative integers $<n$.
245 \IT{(
\kwd*
{NOT
} \VAR{type
})
}
250 \IT{(
\kwd*
{AND
} \OPn{\VAR{type
}}\DF{\T})
}
252 Type specifier for intersection of
\VAR{type
}s.
255 \IT{(
\kwd*
{OR
} \OPn{\VAR{type
}}\DF{\NIL})
}
257 Type specifier for union of
\VAR{type
}s.
260 \IT{(
\kwd*
{VALUES
} \OPn{\VAR{type
}} \OP{\OPn{\kwd{\&optional
} \VAR{type
}}
261 \Op{\kwd{\&rest
} \VAR{other-args
}}})
}
263 Type specifier for multiple values.
269 As a type argument (cf.\ Figure
\ref{data-types
}): no restriction.
277 %%% TeX-master: "clqr"