Common Lisp the Language, 2nd Edition
Next: Predicating Type
Specifiers Up: Type
Specifiers Previous: Type
Specifier Symbols
If a type specifier is a list, the car of the list is a
symbol, and the rest of the list is subsidiary type information. In many
cases a subsidiary item may be unspecified. The unspecified
subsidiary item is indicated by writing *
. For example, to
completely specify a vector type, one must mention the type of the
elements and the length of the vector, as for example
(vector double-float 100)
To leave the length unspecified, one would write
(vector double-float *)
To leave the element type unspecified, one would write
(vector * 100)
One may also leave both length and element type unspecified:
(vector * *)
Suppose that two type specifiers are the same except that the first
has a *
where the second has a more explicit specification.
Then the second denotes a subtype of the type denoted by the first.
As a convenience, if a list has one or more unspecified items at the
end, such items may simply be dropped rather than writing an explicit
*
for each one. If dropping all occurrences of
*
results in a singleton list, then the parentheses may be
dropped as well (the list may be replaced by the symbol in its
car). For example, (vector double-float *)
may be
abbreviated to (vector double-float)
, and
(vector * *)
may be abbreviated to (vector)
and then to simply vector
.
Next: Predicating Type
Specifiers Up: Type
Specifiers Previous: Type
Specifier Symbols
AI.Repository@cs.cmu.edu