Use of Recursion in Lisp

A recursive program is one that calls itself as a subroutine. Use of recursion in Lisp can result in programs that are powerful, yet simple and elegant. Often, a large problem can be handled by a small program which:

  1. Tests for a basic case and computes the value of a basic case directly.

  2. Otherwise, does part of the job and calls itself recursively to do the rest of the job.

A good way to learn recursion, and to gain an appreciation of the beauty of Lisp, is to study definitions of basic Lisp functions written recursively in Lisp. Reference to these definitions can also be used to answer questions about how the functions work in particular cases.

Contents    Page-10    Prev    Next    Page+10    Index