70 lines
4.2 KiB
HTML
70 lines
4.2 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>25.1.2. Compiled Functions</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value=" Compiled Functions">
|
|
<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=tex2html4386 HREF="node227.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html4384 HREF="node224.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html4378 HREF="node225.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html4388 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html4389 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html4387 HREF="node227.html"> Compilation Environment</A>
|
|
<B>Up:</B> <A NAME=tex2html4385 HREF="node224.html"> The Compiler</A>
|
|
<B> Previous:</B> <A NAME=tex2html4379 HREF="node225.html"> Compiler Diagnostics</A>
|
|
<HR> <P>
|
|
<H2><A NAME=SECTION002912000000000000000>25.1.2. Compiled Functions</A></H2>
|
|
<P>
|
|
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
|
|
X3J13 voted in June 1989 (COMPILED-FUNCTION-REQUIREMENTS) <A NAME=28596> </A>
|
|
to impose certain requirements on the functions produced by the compilation
|
|
process.
|
|
<P>
|
|
If a function is of type <tt>compiled-function</tt>, then
|
|
all macro calls appearing lexically within the function have
|
|
already been expanded and will not be expanded again when the
|
|
function is called. The process of
|
|
compilation effectively turns every <tt>macrolet</tt> or <tt>symbol-macrolet</tt>
|
|
construct into a <tt>progn</tt> (or a <tt>locally</tt>) with all
|
|
instances of the local macros in the body fully expanded.
|
|
<P>
|
|
If a function is of type <tt>compiled-function</tt>, then
|
|
all <tt>load-time-value</tt> forms appearing lexically within the function have
|
|
already been pre-evaluated and will not be evaluated
|
|
again when the function is called.
|
|
<P>
|
|
Implementations are free to classify every function as
|
|
a <tt>compiled-function</tt> provided that all functions
|
|
satisfy the preceding requirements.
|
|
Conversely, it is permissible for a function that is
|
|
not a <tt>compiled-function</tt> to satisfy the preceding requirements.
|
|
<P>
|
|
If one or more functions are defined in a file that is compiled
|
|
with <tt>compile-file</tt> and the compiled file is subsequently loaded
|
|
by the function <tt>load</tt>,
|
|
the resulting loaded function definitions must be of
|
|
type <tt>compiled-function</tt>.
|
|
<P>
|
|
The function <tt>compile</tt> must produce an object of type
|
|
<tt>compiled-function</tt> as the value that is either returned
|
|
or stored into the <tt>symbol-function</tt> of a symbol argument.
|
|
<P>
|
|
Note that none of these restrictions addresses questions of the compilation technology or
|
|
target instruction set. For example, a compiled function does not necessarily consist of
|
|
native machine instructions. These requirements merely specify the behavior of the type
|
|
system with respect to certain actions taken by <tt>compile</tt>, <tt>compile-file</tt>, and
|
|
<tt>load</tt>.
|
|
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html4386 HREF="node227.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html4384 HREF="node224.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html4378 HREF="node225.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html4388 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html4389 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html4387 HREF="node227.html"> Compilation Environment</A>
|
|
<B>Up:</B> <A NAME=tex2html4385 HREF="node224.html"> The Compiler</A>
|
|
<B> Previous:</B> <A NAME=tex2html4379 HREF="node225.html"> Compiler Diagnostics</A>
|
|
<HR> <P>
|
|
<HR>
|
|
<P><ADDRESS>
|
|
AI.Repository@cs.cmu.edu
|
|
</ADDRESS>
|
|
</BODY>
|