emacs.d/clones/lisp/colinallen.dnsalias.org/lp/node93.html

63 lines
1.7 KiB
HTML
Raw Normal View History

2022-08-02 12:34:59 +02:00
<!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> eval (FUNCTION)</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" eval (FUNCTION)">
<meta name="keywords" value="lp">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<BR> <HR>
<A HREF="node94.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="node92.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="node94.html"> evenpoddp (PREDICATES)</A>
<B>Up:</B>
<A HREF="node72.html"> Appendix: Selected Lisp </A>
<B> Previous:</B>
<A HREF="node92.html"> eql (PREDICATE)</A>
<BR> <HR> <P>
<H1> eval (FUNCTION)</H1>
<P>
<b> Format:</b>
<tt> (eval &lt;exp&gt; )</tt>
<P>
<b> Required arguments:</b>
1
<P>
<tt> &lt;exp&gt; </tt>: any Lisp expression.
<P>
eval provides direct access to the Lisp expression evaluator. It causes the evaluation of whatever <tt> &lt;exp&gt; </tt> returns. Thus, if <tt> &lt;exp&gt; </tt> is an evaluable Lisp expression that returns an evaluable Lisp expression, then eval returns the value of evaluating this second expression.
<P>
<b> Examples:</b>
<P>
<BLOCKQUOTE>
<PRE>&gt; (eval '(+ 1 2))
3
&gt; (eval (cons '+ '(1 2)))
3
&gt; (eval 3)
3
&gt; (eval (+ 3 4))
7
&gt; (eval (cons 'a '(s d f)))
Error: The function A is undefined.
</PRE>
</BLOCKQUOTE>
<P>
<BR> <HR>
<P>
<ADDRESS>
<I>&#169; Colin Allen &amp; Maneesh Dhagat <BR>
March 2007 </I>
</ADDRESS>
</BODY>