61 lines
1.9 KiB
HTML
61 lines
1.9 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> Recursion and Iteration</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value=" Recursion and Iteration">
|
|
<meta name="keywords" value="lp">
|
|
<meta name="resource-type" value="document">
|
|
<meta name="distribution" value="global">
|
|
<P>
|
|
<BR> <HR>
|
|
<A HREF="node30.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A>
|
|
<A HREF="lp.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A>
|
|
<A HREF="node28.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="node30.html"> Recursive Definitions</A>
|
|
<B>Up:</B>
|
|
<A HREF="lp.html">Lisp Primer</A>
|
|
<B> Previous:</B>
|
|
<A HREF="node28.html"> Exercises</A>
|
|
<BR> <HR> <P>
|
|
<H1> Recursion and Iteration</H1>
|
|
<P>
|
|
Many, if not most, uses for computers involve repetitive procedures. Lisp provides two paradigms for controlling repetition -- recursion and iteration -- both covered in this chapter. Also in this chapter you will find out how to set up code blocks with local variables using let.
|
|
<P>
|
|
<BR> <HR>
|
|
<UL>
|
|
<LI>
|
|
<A HREF="node30.html"> Recursive Definitions</A>
|
|
<UL>
|
|
<LI>
|
|
<A HREF="node31.html"> A Simple Example</A>
|
|
<LI>
|
|
<A HREF="node32.html"> Using Trace To Watch Recursion</A>
|
|
<LI>
|
|
<A HREF="node33.html"> Another Example</A>
|
|
</UL>
|
|
<LI>
|
|
<A HREF="node34.html"> Iteration Using Dotimes</A>
|
|
<LI>
|
|
<A HREF="node35.html"> Local Variables Using Let</A>
|
|
<LI>
|
|
<A HREF="node36.html"> Iteration Using Dolist</A>
|
|
<LI>
|
|
<A HREF="node37.html"> When To Use Recursion/When To Use Iteration</A>
|
|
<LI>
|
|
<A HREF="node38.html"> Tail Recursion</A>
|
|
<LI>
|
|
<A HREF="node39.html"> Timing Function Calls</A>
|
|
<LI>
|
|
<A HREF="node40.html"> Exercises</A>
|
|
</UL>
|
|
<BR> <HR>
|
|
<P>
|
|
<ADDRESS>
|
|
<I>© Colin Allen & Maneesh Dhagat <BR>
|
|
March 2007 </I>
|
|
</ADDRESS>
|
|
</BODY>
|