64 lines
3.4 KiB
HTML
64 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> 1.2.3. Evaluation, Expansion, and Equivalence</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value=" Evaluation, Expansion, and Equivalence">
|
|
<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=tex2html1608 HREF="node11.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html1606 HREF="node7.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html1600 HREF="node9.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html1610 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html1611 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html1609 HREF="node11.html"> Errors</A>
|
|
<B>Up:</B> <A NAME=tex2html1607 HREF="node7.html"> Notational Conventions</A>
|
|
<B> Previous:</B> <A NAME=tex2html1601 HREF="node9.html"> NilFalse, and </A>
|
|
<HR> <P>
|
|
<H2><A NAME=SECTION00523000000000000000> 1.2.3. Evaluation, Expansion, and Equivalence</A></H2>
|
|
<P>
|
|
Execution of code in Lisp is called <i>evaluation</i> because executing a
|
|
piece of code normally results in a data object called the <i>value</i>
|
|
produced by the code. The symbol <tt>=></tt> is used in examples to
|
|
indicate evaluation.
|
|
For example,
|
|
<P><pre>
|
|
(+ 4 5) => 9
|
|
</pre><P>
|
|
means ``the result of evaluating the code <tt>(+ 4 5)</tt> is (or would be,
|
|
or would have been) <tt>9</tt>.''
|
|
<P>
|
|
The symbol -> is used in examples to indicate macro expansion.
|
|
For example,
|
|
<P><pre>
|
|
(push x v) -> (setf v (cons x v))
|
|
</pre><P>
|
|
means ``the result of expanding the macro-call form <tt>(push x v)</tt>
|
|
is <tt>(setf v (cons x v))</tt>.'' This implies that the two pieces
|
|
of code do the same thing; the second piece of code is
|
|
the definition of what the first does.
|
|
<P>
|
|
The symbol == is used in examples to indicate code equivalence.
|
|
For example,
|
|
<P><pre>
|
|
(gcd x (gcd y z)) == (gcd (gcd x y) z)
|
|
</pre><P>
|
|
means ``the value and effects of evaluating the form
|
|
<tt>(gcd x (gcd y z))</tt> are always the same as the value
|
|
and effects of
|
|
<tt>(gcd (gcd x y) z)</tt> for any values of the
|
|
variables <tt>x</tt>, <tt>y</tt>, and <tt>z</tt>.''
|
|
This implies that the two pieces
|
|
of code do the same thing; however, neither directly defines
|
|
the other in the way macro expansion does.
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html1608 HREF="node11.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html1606 HREF="node7.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html1600 HREF="node9.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html1610 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html1611 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html1609 HREF="node11.html"> Errors</A>
|
|
<B>Up:</B> <A NAME=tex2html1607 HREF="node7.html"> Notational Conventions</A>
|
|
<B> Previous:</B> <A NAME=tex2html1601 HREF="node9.html"> NilFalse, and </A>
|
|
<HR> <P>
|
|
<HR>
|
|
<P><ADDRESS>
|
|
AI.Repository@cs.cmu.edu
|
|
</ADDRESS>
|
|
</BODY>
|