48 lines
12 KiB
HTML
48 lines
12 KiB
HTML
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>CLHS: Section 3.2.1</TITLE>
|
|
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
|
|
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
|
|
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
|
|
<LINK REL=TOP HREF="../Front/index.htm">
|
|
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
|
|
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
|
|
<LINK REL=PREV HREF="03_b.htm">
|
|
<LINK REL=UP HREF="03_b.htm">
|
|
<LINK REL=NEXT HREF="03_bb.htm">
|
|
</HEAD>
|
|
<BODY>
|
|
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="03_b.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="03_b.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="03_bb.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<H2>
|
|
3.2.1 Compiler Terminology</H2> <P>
|
|
The following terminology is used in this section. <P>
|
|
The <A REL=DEFINITION HREF="26_glo_c.htm#compiler"><I>compiler</I></A> is a utility that translates code into an <A REL=DEFINITION HREF="26_glo_i.htm#implementation-dependent"><I>implementation-dependent</I></A> form that might be represented or executed efficiently. The term <A REL=DEFINITION HREF="26_glo_c.htm#compiler"><I>compiler</I></A> refers to both of the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>functions</I></A> <A REL=DEFINITION HREF="f_cmp.htm#compile"><B>compile</B></A> and <A REL=DEFINITION HREF="f_cmp_fi.htm#compile-file"><B>compile-file</B></A>. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_c.htm#compiled_code"><I>compiled code</I></A> refers to <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>objects</I></A> representing compiled programs, such as <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>objects</I></A> constructed by <A REL=DEFINITION HREF="f_cmp.htm#compile"><B>compile</B></A> or by <A REL=DEFINITION HREF="f_load.htm#load"><B>load</B></A> when <I>loading</I> a <A REL=DEFINITION HREF="26_glo_c.htm#compiled_file"><I>compiled file</I></A>. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_i.htm#implicit_compilation"><I>implicit compilation</I></A> refers to <A REL=DEFINITION HREF="26_glo_c.htm#compilation"><I>compilation</I></A> performed during <A REL=DEFINITION HREF="26_glo_e.htm#evaluation"><I>evaluation</I></A>. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_l.htm#literal"><I>literal</I></A> <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> refers to a quoted <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> or a <A REL=DEFINITION HREF="26_glo_s.htm#self-evaluating_object"><I>self-evaluating object</I></A> or an <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> that is a substructure of such an <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A>. A <A REL=DEFINITION HREF="26_glo_c.htm#constant_variable"><I>constant variable</I></A> is not itself a <A REL=DEFINITION HREF="26_glo_l.htm#literal"><I>literal</I></A> <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A>. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_c.htm#coalesce"><I>coalesce</I></A> is defined as follows. Suppose <TT>A</TT> and <TT>B</TT> are two <A REL=DEFINITION HREF="26_glo_l.htm#literal"><I>literal</I></A> <A REL=DEFINITION HREF="26_glo_c.htm#constant"><I>constants</I></A> in the <A REL=DEFINITION HREF="26_glo_s.htm#source_code"><I>source code</I></A>, and that <TT>A'</TT> and <TT>B'</TT> are the corresponding <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>objects</I></A> in the <A REL=DEFINITION HREF="26_glo_c.htm#compiled_code"><I>compiled code</I></A>. If <TT>A'</TT> and <TT>B'</TT> are <A REL=DEFINITION HREF="f_eql.htm#eql"><B>eql</B></A> but <TT>A</TT> and <TT>B</TT> are not <A REL=DEFINITION HREF="f_eql.htm#eql"><B>eql</B></A>, then it is said that <TT>A</TT> and <TT>B</TT> have been coalesced by the compiler. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_m.htm#minimal_compilation"><I>minimal compilation</I></A> refers to actions the compiler must take at <A REL=DEFINITION HREF="26_glo_c.htm#compile_time"><I>compile time</I></A>. These actions are specified in <A REL=CHILD HREF="03_bb.htm">Section 3.2.2 (Compilation Semantics)</A>. <P>
|
|
The verb <A REL=DEFINITION HREF="26_glo_p.htm#process"><I>process</I></A> refers to performing <A REL=DEFINITION HREF="26_glo_m.htm#minimal_compilation"><I>minimal compilation</I></A>, determining the time of evaluation for a <A REL=DEFINITION HREF="26_glo_f.htm#form"><I>form</I></A>, and possibly <I>evaluating</I> that <A REL=DEFINITION HREF="26_glo_f.htm#form"><I>form</I></A> (if required). <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_f.htm#further_compilation"><I>further compilation</I></A> refers to <A REL=DEFINITION HREF="26_glo_i.htm#implementation-dependent"><I>implementation-dependent</I></A> compilation beyond <A REL=DEFINITION HREF="26_glo_m.htm#minimal_compilation"><I>minimal compilation</I></A>. That is, <I>processing</I> does not imply complete compilation. Block compilation and generation of machine-specific instructions are examples of further compilation. Further compilation is permitted to take place at <A REL=DEFINITION HREF="26_glo_r.htm#run_time"><I>run time</I></A>. <P>
|
|
Four different <A REL=DEFINITION HREF="26_glo_e.htm#environment"><I>environments</I></A> relevant to compilation are distinguished: the <A REL=DEFINITION HREF="26_glo_s.htm#startup_environment"><I>startup environment</I></A>, the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A>, the <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A>, and the <A REL=DEFINITION HREF="26_glo_r.htm#run-time_environment"><I>run-time environment</I></A>. <P>
|
|
The <A REL=DEFINITION HREF="26_glo_s.htm#startup_environment"><I>startup environment</I></A> is the <A REL=DEFINITION HREF="26_glo_e.htm#environment"><I>environment</I></A> of the <A REL=DEFINITION HREF="26_glo_l.htm#lisp_image"><I>Lisp image</I></A> from which the <A REL=DEFINITION HREF="26_glo_c.htm#compiler"><I>compiler</I></A> was invoked. <P>
|
|
The <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> is maintained by the compiler and is used to hold definitions and declarations to be used internally by the compiler. Only those parts of a definition needed for correct compilation are saved. The <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> is used as the <A REL=DEFINITION HREF="26_glo_e.htm#environment"><I>environment</I></A> <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A> to macro expanders called by the compiler. It is unspecified whether a definition available in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> can be used in an <A REL=DEFINITION HREF="26_glo_e.htm#evaluation"><I>evaluation</I></A> initiated in the <A REL=DEFINITION HREF="26_glo_s.htm#startup_environment"><I>startup environment</I></A> or <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A>. <P>
|
|
The <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A> is a <A REL=DEFINITION HREF="26_glo_r.htm#run-time_environment"><I>run-time environment</I></A> in which macro expanders and code specified by <A REL=DEFINITION HREF="s_eval_w.htm#eval-when"><B>eval-when</B></A> to be evaluated are evaluated. All evaluations initiated by the <A REL=DEFINITION HREF="26_glo_c.htm#compiler"><I>compiler</I></A> take place in the <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A>. <P>
|
|
The <A REL=DEFINITION HREF="26_glo_r.htm#run-time_environment"><I>run-time environment</I></A> is the <A REL=DEFINITION HREF="26_glo_e.htm#environment"><I>environment</I></A> in which the program being compiled will be executed. <P>
|
|
The <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> inherits from the <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A>, and the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> and <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A> might be <A REL=DEFINITION HREF="26_glo_i.htm#identical"><I>identical</I></A>. The <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A> inherits from the <A REL=DEFINITION HREF="26_glo_s.htm#startup_environment"><I>startup environment</I></A>, and the <A REL=DEFINITION HREF="26_glo_s.htm#startup_environment"><I>startup environment</I></A> and <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A> might be <A REL=DEFINITION HREF="26_glo_i.htm#identical"><I>identical</I></A>. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_c.htm#compile_time"><I>compile time</I></A> refers to the duration of time that the compiler is processing <A REL=DEFINITION HREF="26_glo_s.htm#source_code"><I>source code</I></A>. At <A REL=DEFINITION HREF="26_glo_c.htm#compile_time"><I>compile time</I></A>, only the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> and the <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A> are available. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_c.htm#compile-time_definition"><I>compile-time definition</I></A> refers to a definition in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A>. For example, when compiling a file, the definition of a function might be retained in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> if it is declared <A REL=DEFINITION HREF="d_inline.htm#inline"><B>inline</B></A>. This definition might not be available in the <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A>. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_r.htm#run_time"><I>run time</I></A> refers to the duration of time that the loader is loading compiled code or compiled code is being executed. At run time, only the <A REL=DEFINITION HREF="26_glo_r.htm#run-time_environment"><I>run-time environment</I></A> is available. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_r.htm#run-time_definition"><I>run-time definition</I></A> refers to a definition in the <A REL=DEFINITION HREF="26_glo_r.htm#run-time_environment"><I>run-time environment</I></A>. <P>
|
|
The term <A REL=DEFINITION HREF="26_glo_r.htm#run-time_compiler"><I>run-time compiler</I></A> refers to the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> <A REL=DEFINITION HREF="f_cmp.htm#compile"><B>compile</B></A> or <A REL=DEFINITION HREF="26_glo_i.htm#implicit_compilation"><I>implicit compilation</I></A>, for which the compilation and run-time <A REL=DEFINITION HREF="26_glo_e.htm#environment"><I>environments</I></A> are maintained in the same <A REL=DEFINITION HREF="26_glo_l.htm#lisp_image"><I>Lisp image</I></A>. Note that when the <A REL=DEFINITION HREF="26_glo_r.htm#run-time_compiler"><I>run-time compiler</I></A> is used, the <A REL=DEFINITION HREF="26_glo_r.htm#run-time_environment"><I>run-time environment</I></A> and <A REL=DEFINITION HREF="26_glo_s.htm#startup_environment"><I>startup environment</I></A> are the same. <P>
|
|
<HR>
|
|
|
|
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
|
|
|
|
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
|
|
</BODY>
|
|
</HTML>
|