68 lines
3.7 KiB
HTML
68 lines
3.7 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
|
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
|
<HEAD>
|
|
<TITLE>4.2. Type Specifier Lists</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value=" Type Specifier Lists">
|
|
<meta name="keywords" value="clm">
|
|
<meta name="resource-type" value="document">
|
|
<meta name="distribution" value="global">
|
|
<P>
|
|
<b>Common Lisp the Language, 2nd Edition</b>
|
|
<BR> <HR><A NAME=tex2html2079 HREF="node47.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html2077 HREF="node44.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html2071 HREF="node45.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html2081 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html2082 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html2080 HREF="node47.html"> Predicating Type Specifiers</A>
|
|
<B>Up:</B> <A NAME=tex2html2078 HREF="node44.html"> Type Specifiers</A>
|
|
<B> Previous:</B> <A NAME=tex2html2072 HREF="node45.html"> Type Specifier Symbols</A>
|
|
<HR> <P>
|
|
<H1><A NAME=SECTION00820000000000000000>4.2. Type Specifier Lists</A></H1>
|
|
<P>
|
|
If a type specifier is a list, the <i>car</i>
|
|
of the list is a symbol, and the rest of the list is subsidiary
|
|
type information. In many cases a subsidiary item may be
|
|
<i>unspecified</i>. The unspecified subsidiary item is indicated
|
|
by writing <tt>*</tt>. 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
|
|
<P><pre>
|
|
(vector double-float 100)
|
|
</pre><P>
|
|
To leave the length unspecified, one would write
|
|
<P><pre>
|
|
(vector double-float *)
|
|
</pre><P>
|
|
To leave the element type unspecified, one would write
|
|
<P><pre>
|
|
(vector * 100)
|
|
</pre><P>
|
|
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
|
|
One may also leave both length and element type unspecified:
|
|
<P><pre>
|
|
(vector * *)
|
|
</pre>
|
|
<img align=bottom alt="change_end" src="gif/change_end.gif">
|
|
<P>
|
|
Suppose that two type specifiers are the same except that the first
|
|
has a <tt>*</tt> where the second has a more explicit specification.
|
|
Then the second denotes a subtype of the type denoted by the first.
|
|
<P>
|
|
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 <tt>*</tt> for each one.
|
|
If dropping all occurrences of <tt>*</tt> results in a singleton list,
|
|
then the parentheses may be dropped as well (the list may be replaced
|
|
by the symbol in its <i>car</i>). For example,
|
|
<tt>(vector double-float *)</tt> may be abbreviated to <tt>(vector double-float)</tt>,
|
|
and <tt>(vector * *)</tt> may be abbreviated to <tt>(vector)</tt> and then to
|
|
simply <tt>vector</tt>.
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html2079 HREF="node47.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html2077 HREF="node44.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html2071 HREF="node45.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html2081 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html2082 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html2080 HREF="node47.html"> Predicating Type Specifiers</A>
|
|
<B>Up:</B> <A NAME=tex2html2078 HREF="node44.html"> Type Specifiers</A>
|
|
<B> Previous:</B> <A NAME=tex2html2072 HREF="node45.html"> Type Specifier Symbols</A>
|
|
<HR> <P>
|
|
<HR>
|
|
<P><ADDRESS>
|
|
AI.Repository@cs.cmu.edu
|
|
</ADDRESS>
|
|
</BODY>
|