60 lines
1.8 KiB
HTML
60 lines
1.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
|
<!Originally converted to HTML using LaTeX2HTML 95 (Thu Jan 19 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
|
<HEAD>
|
|
<TITLE> caar, cadr, cdar, cddr, etc. (FUNCTIONS)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value=" caar, cadr, cdar, cddr, etc. (FUNCTIONS)">
|
|
<meta name="keywords" value="lp">
|
|
<meta name="resource-type" value="document">
|
|
<meta name="distribution" value="global">
|
|
<P>
|
|
<BR> <HR>
|
|
<A HREF="node86.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A>
|
|
<A HREF="node72.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A>
|
|
<A HREF="node84.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <BR>
|
|
<A HREF="lp.html"><B>Contents</B></A>
|
|
<B> Next:</B>
|
|
<A HREF="node86.html"> cdr (Function)</A>
|
|
<B>Up:</B>
|
|
<A HREF="node72.html"> Appendix: Selected Lisp </A>
|
|
<B> Previous:</B>
|
|
<A HREF="node84.html"> car (FUNCTION)</A>
|
|
<BR> <HR> <P>
|
|
<H1> caar, cadr, cdar, cddr, etc. (FUNCTIONS)</H1>
|
|
<P>
|
|
<b> Format:</b>
|
|
<tt> (c-r <list> )</tt>
|
|
<P>
|
|
<b> Required arguments:</b>
|
|
1
|
|
<P>
|
|
Argument must evaluate to a list (or cons pair).
|
|
<P>
|
|
The function <em> cxyr</em> is a composition of the function <em> cxr</em> with <em> cyr</em>. So, for example, <tt> (cadr foo)</tt> is equivalent to <tt> (car (cdr foo))</tt>, etc. Full implementation of the ANSI Common Lisp specification provides for up to 4 letters, a or d, to appear between the c and the r.
|
|
<P>
|
|
<b> Examples:</b>
|
|
<P>
|
|
<BLOCKQUOTE>
|
|
<PRE>> (setf ds9 '(Sisko Kira Dax Odo Bashir OBrien))
|
|
(SISKO KIRA DAX ODO BASHIR OBRIEN)
|
|
|
|
> (cadr ds9)
|
|
KIRA
|
|
|
|
> (cddr ds9)
|
|
(DAX ODO BASHIR OBRIEN)
|
|
|
|
> (cddar ds9)
|
|
|
|
Error: SISKO is not of type LIST.
|
|
</PRE>
|
|
</BLOCKQUOTE>
|
|
<P>
|
|
<BR> <HR>
|
|
<P>
|
|
<ADDRESS>
|
|
<I>© Colin Allen & Maneesh Dhagat <BR>
|
|
March 2007 </I>
|
|
</ADDRESS>
|
|
</BODY>
|