63 lines
3.4 KiB
HTML
63 lines
3.4 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>5. Program Structure</TITLE>
|
||
|
</HEAD>
|
||
|
<BODY>
|
||
|
<meta name="description" value=" Program Structure">
|
||
|
<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=tex2html2185 HREF="node56.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html2183 HREF="clm.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html2177 HREF="node54.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html2187 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html2188 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
||
|
<B> Next:</B> <A NAME=tex2html2186 HREF="node56.html"> Forms</A>
|
||
|
<B>Up:</B> <A NAME=tex2html2184 HREF="clm.html">Common Lisp the Language</A>
|
||
|
<B> Previous:</B> <A NAME=tex2html2178 HREF="node54.html"> Type Upgrading</A>
|
||
|
<HR> <P>
|
||
|
<H1><A NAME=SECTION00900000000000000000>5. Program Structure</A></H1>
|
||
|
<P>
|
||
|
<A NAME=PROGS>In</A>
|
||
|
chapter <A HREF="node15.html#DTYPES">2</A> the syntax was sketched for notating data objects
|
||
|
in Common Lisp. The same syntax is used for notating programs because all
|
||
|
Common Lisp programs have a representation as Common Lisp data objects.
|
||
|
<P>
|
||
|
Lisp programs are organized as forms and functions. Forms are
|
||
|
<i>evaluated</i> (relative to some context) to produce values and side
|
||
|
effects. Functions are invoked by <i>applying</i> them to arguments.
|
||
|
The most important kind of form performs a function call;
|
||
|
conversely, a function performs computation by evaluating forms.
|
||
|
<P>
|
||
|
In this chapter, forms are discussed first and then functions.
|
||
|
Finally, certain ``top level'' special forms are discussed; the most
|
||
|
important of these is <tt>defun</tt>, whose purpose is to define a
|
||
|
named function.
|
||
|
<P>
|
||
|
<HR>
|
||
|
<UL>
|
||
|
<LI> <A NAME=tex2html2189 HREF="node56.html#SECTION00910000000000000000"> Forms</A>
|
||
|
<UL>
|
||
|
<LI> <A NAME=tex2html2190 HREF="node57.html#SECTION00911000000000000000"> Self-Evaluating Forms</A>
|
||
|
<LI> <A NAME=tex2html2191 HREF="node58.html#SECTION00912000000000000000"> Variables</A>
|
||
|
<LI> <A NAME=tex2html2192 HREF="node59.html#SECTION00913000000000000000"> Special Forms</A>
|
||
|
<LI> <A NAME=tex2html2193 HREF="node60.html#SECTION00914000000000000000"> Macros</A>
|
||
|
<LI> <A NAME=tex2html2194 HREF="node61.html#SECTION00915000000000000000"> Function Calls</A>
|
||
|
</UL>
|
||
|
<LI> <A NAME=tex2html2195 HREF="node62.html#SECTION00920000000000000000"> Functions</A>
|
||
|
<UL>
|
||
|
<LI> <A NAME=tex2html2196 HREF="node63.html#SECTION00921000000000000000"> Named Functions</A>
|
||
|
<LI> <A NAME=tex2html2197 HREF="node64.html#SECTION00922000000000000000"> Lambda-Expressions</A>
|
||
|
</UL>
|
||
|
<LI> <A NAME=tex2html2198 HREF="node65.html#SECTION00930000000000000000"> Top-Level Forms</A>
|
||
|
<UL>
|
||
|
<LI> <A NAME=tex2html2199 HREF="node66.html#SECTION00931000000000000000"> Defining Named Functions</A>
|
||
|
<LI> <A NAME=tex2html2200 HREF="node67.html#SECTION00932000000000000000"> Declaring Global Variables and Named Constants</A>
|
||
|
<LI> <A NAME=tex2html2201 HREF="node68.html#SECTION00933000000000000000"> Control of Time of Evaluation</A>
|
||
|
</UL>
|
||
|
</UL>
|
||
|
<HR>
|
||
|
<P><ADDRESS>
|
||
|
AI.Repository@cs.cmu.edu
|
||
|
</ADDRESS>
|
||
|
</BODY>
|