47 lines
8.9 KiB
HTML
47 lines
8.9 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.2.3</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_bbb.htm">
|
|
<LINK REL=UP HREF="03_bb.htm">
|
|
<LINK REL=NEXT HREF="03_bc.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_bbb.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="03_bb.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="03_bc.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<H2>
|
|
3.2.2.3 Semantic Constraints</H2> <P>
|
|
All <A REL=DEFINITION HREF="26_glo_c.htm#conforming_program"><I>conforming programs</I></A> must obey the following constraints, which are designed to minimize the observable differences between compiled and interpreted programs: <P>
|
|
<P><UL><LI> Definitions of any referenced <A REL=DEFINITION HREF="26_glo_m.htm#macro"><I>macros</I></A> must be present in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A>. Any <A REL=DEFINITION HREF="26_glo_f.htm#form"><I>form</I></A> that is a <A REL=DEFINITION HREF="26_glo_l.htm#list"><I>list</I></A> beginning with a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> that does not name a <A REL=DEFINITION HREF="26_glo_s.htm#special_operator"><I>special operator</I></A> or a <A REL=DEFINITION HREF="26_glo_m.htm#macro"><I>macro</I></A> defined in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> is treated by the compiler as a function call. <P>
|
|
<LI> <A REL=DEFINITION HREF="d_specia.htm#special"><B>Special</B></A> proclamations for <A REL=DEFINITION HREF="26_glo_d.htm#dynamic_variable"><I>dynamic variables</I></A> must be made in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A>. Any <A REL=DEFINITION HREF="26_glo_b.htm#binding"><I>binding</I></A> for which there is no <A REL=DEFINITION HREF="d_specia.htm#special"><B>special</B></A> declaration or proclamation in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> is treated by the compiler as a <A REL=DEFINITION HREF="26_glo_l.htm#lexical_binding"><I>lexical binding</I></A>. <P>
|
|
<LI> The definition of a function that is defined and declared <A REL=DEFINITION HREF="d_inline.htm#inline"><B>inline</B></A> in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> must be the same at run time. <P>
|
|
<LI> Within a <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> named F, the compiler may (but is not required to) assume that an apparent recursive call to a <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> named F refers to the same definition of F, unless that function has been declared <A REL=DEFINITION HREF="d_inline.htm#notinline"><B>notinline</B></A>. The consequences of redefining such a recursively defined <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> F while it is executing are undefined. <P>
|
|
<LI> A call within a file to a named function that is defined in the same file refers to that function, unless that function has been declared <A REL=DEFINITION HREF="d_inline.htm#notinline"><B>notinline</B></A>. The consequences are unspecified if functions are redefined individually at run time or multiply defined in the same file. <P>
|
|
<LI> The argument syntax and number of return values for all functions whose <A REL=DEFINITION HREF="d_ftype.htm#ftype"><B>ftype</B></A> is declared at compile time must remain the same at run time. <P>
|
|
<LI> <A REL=DEFINITION HREF="26_glo_c.htm#constant_variable"><I>Constant variables</I></A> defined in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> must have a <A REL=DEFINITION HREF="26_glo_s.htm#similar"><I>similar</I></A> value at run time. A reference to a <A REL=DEFINITION HREF="26_glo_c.htm#constant_variable"><I>constant variable</I></A> in <A REL=DEFINITION HREF="26_glo_s.htm#source_code"><I>source code</I></A> is equivalent to a reference to 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> that is the <A REL=DEFINITION HREF="26_glo_v.htm#value"><I>value</I></A> of the <A REL=DEFINITION HREF="26_glo_c.htm#constant_variable"><I>constant variable</I></A>. <P>
|
|
<LI> Type definitions made with <A REL=DEFINITION HREF="m_deftp.htm#deftype"><B>deftype</B></A> or <A REL=DEFINITION HREF="m_defstr.htm#defstruct"><B>defstruct</B></A> in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> must retain the same definition at run time. Classes defined by <A REL=DEFINITION HREF="m_defcla.htm#defclass"><B>defclass</B></A> in the <A REL=DEFINITION HREF="26_glo_c.htm#compilation_environment"><I>compilation environment</I></A> must be defined at run time to have the same <A REL=DEFINITION HREF="26_glo_s.htm#superclass"><I>superclasses</I></A> and same <A REL=DEFINITION HREF="26_glo_m.htm#metaclass"><I>metaclass</I></A>. <P>
|
|
This implies that <A REL=DEFINITION HREF="26_glo_s.htm#subtype"><I>subtype</I></A>/<A REL=DEFINITION HREF="26_glo_s.htm#supertype"><I>supertype</I></A> relationships of <A REL=DEFINITION HREF="26_glo_t.htm#type_specifier"><I>type specifiers</I></A> must not change between <A REL=DEFINITION HREF="26_glo_c.htm#compile_time"><I>compile time</I></A> and <A REL=DEFINITION HREF="26_glo_r.htm#run_time"><I>run time</I></A>. <P>
|
|
<LI> Type declarations present in the compilation <A REL=DEFINITION HREF="26_glo_e.htm#environment"><I>environment</I></A> must accurately describe the corresponding values at run time; otherwise, the consequences are undefined. It is permissible for an unknown <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> to appear in a declaration at compile time, though a warning might be signaled in such a case. <P>
|
|
<LI> Except in the situations explicitly listed above, a <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> defined in the <A REL=DEFINITION HREF="26_glo_e.htm#evaluation_environment"><I>evaluation environment</I></A> is permitted to have a different definition or a different <A REL=DEFINITION HREF="26_glo_s.htm#signature"><I>signature</I></A> at run time, and the run-time definition prevails. <P>
|
|
<P></UL><P>
|
|
<A REL=DEFINITION HREF="26_glo_c.htm#conforming_program"><I>Conforming programs</I></A> should not be written using any additional assumptions about consistency between the run-time <A REL=DEFINITION HREF="26_glo_e.htm#environment"><I>environment</I></A> and the startup, evaluation, and compilation <A REL=DEFINITION HREF="26_glo_e.htm#environment"><I>environments</I></A>. <P>
|
|
Except where noted, when a compile-time and a run-time definition are different, one of the following occurs at run time: <P>
|
|
<P><UL><P>
|
|
<LI> an error of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="e_error.htm#error"><B>error</B></A> is signaled <LI> the compile-time definition prevails <LI> the run-time definition prevails <P>
|
|
<P></UL><P>
|
|
If the <A REL=DEFINITION HREF="26_glo_c.htm#compiler"><I>compiler</I></A> processes a <A REL=DEFINITION HREF="26_glo_f.htm#function_form"><I>function form</I></A> whose <A REL=DEFINITION HREF="26_glo_o.htm#operator"><I>operator</I></A> is not defined at compile time, no error is signaled at compile time. <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>
|