emacs.d/clones/colinallen.dnsalias.org/lp/node-rest.html

62 lines
1.6 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> rest (FUNCTION)</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" rest (FUNCTION)">
<meta name="keywords" value="lp">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<BR> <HR>
<A HREF="node111.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="node110.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="node111.html"> reverse (FUNCTION)</A>
<B>Up:</B>
<A HREF="node72.html"> Appendix: Selected Lisp </A>
<B> Previous:</B>
<A HREF="node110.html"> read (FUNCTION)</A>
<BR> <HR> <P>
<H1> rest (FUNCTION)</H1>
<P>
<b> Format:</b>
<tt> (rest &lt;exp&gt; )</tt>
<P>
<b> Required arguments:</b>
1
<P>
<tt> &lt;exp&gt; </tt>: any Lisp expression which returns a list
<P>
The argument expression must evaluate to a list; rest returns all but the first element of this list. If the list is empty, i.e. is nil, rest returns nil.
<P>
<b> Examples:</b>
<P>
<BLOCKQUOTE>
<PRE>&gt; (rest '(1 2 3))
(2 3)
&gt; (rest '((a (b (c)) d) e (f)))
(E (F))
&gt; (rest '(z))
NIL
&gt; (rest ())
NIL
&gt; (rest 'a)
Error: A is not of type LIST
</PRE>
</BLOCKQUOTE>
<P>
<BR> <HR>
<P>
<ADDRESS>
<I>&#169; Colin Allen &amp; Maneesh Dhagat <BR>
March 2007 </I>
</ADDRESS>
</BODY>