emacs.d/clones/lisp/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node349.html

61 lines
3.2 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>A.2. Series Functions</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Series Functions">
<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=tex2html6062 HREF="node350.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html6060 HREF="node347.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html6054 HREF="node348.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html6064 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html6065 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html6063 HREF="node350.html"> Scanners</A>
<B>Up:</B> <A NAME=tex2html6061 HREF="node347.html"> Series</A>
<B> Previous:</B> <A NAME=tex2html6055 HREF="node348.html"> Introduction</A>
<HR> <P>
<H1><A NAME=SECTION003420000000000000000>A.2. Series Functions</A></H1>
<P>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
<A NAME=SERIESFSECTION>Throughout</A> this chapter the notation <tt>S<IMG ALIGN=BOTTOM ALT="" SRC="_24769_tex2html_wrap44030.gif"></tt> is used to
denote the <i>j</i>th element of the series <tt>S</tt>. As in a list or
vector, the first element of a series has the subscript zero.
<P>
The <tt>#</tt> macro character syntax <tt>#Z<i>list</i></tt> denotes a series that contains
the elements of <i>list</i>. This syntax is also used when series are printed.
<P><pre>
(choose-if #'symbolp #Z(a 2 b)) => #Z(a b)
</pre><P>
Series are self-evaluating objects and the series data type is disjoint
from all other types.
<P>
<BR><b>[Type specifier]</b><BR>
<tt>series <i>element-type</i></tt><P>The type specifier <tt>(series <i>element-type</i>)</tt>
denotes the set of series whose elements are all
members of the type <i>element-type</i>.
<P>
<BR><b>[Function]</b><BR>
<tt>series <em>arg</em> &amp;rest <em>args</em></tt><P>The function <tt>series</tt> returns an unbounded series that endlessly repeats the
values of the arguments. The second example below shows the preferred
method for constructing a bounded series.
<P><pre>
(series 'b 'c) => #Z(b c b c b c ...)
(scan (list 'a 'b 'c)) => #Z(a b c)
</pre><P>
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
<P>
<HR>
<UL>
<LI> <A NAME=tex2html6066 HREF="node350.html#SECTION003421000000000000000"> Scanners</A>
<LI> <A NAME=tex2html6067 HREF="node351.html#SECTION003422000000000000000"> Mapping</A>
<LI> <A NAME=tex2html6068 HREF="node352.html#SECTION003423000000000000000"> Truncation and Other Simple Transducers</A>
<LI> <A NAME=tex2html6069 HREF="node353.html#SECTION003424000000000000000"> Conditional and Other Complex Transducers</A>
<LI> <A NAME=tex2html6070 HREF="node354.html#SECTION003425000000000000000"> Collectors</A>
<LI> <A NAME=tex2html6071 HREF="node355.html#SECTION003426000000000000000"> Alteration of Series</A>
</UL>
<HR>
<P><ADDRESS>
AI.Repository@cs.cmu.edu
</ADDRESS>
</BODY>