1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Issues/iss058_w.htm
2024-04-01 10:24:07 +02:00

89 lines
5.2 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: Issue COMPILE-ARGUMENT-PROBLEMS-AGAIN Writeup</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="../Issues/iss057_w.htm">
<LINK REL=UP HREF="../Issues/iss058.htm">
<LINK REL=NEXT HREF="../Issues/iss059_w.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="../Issues/iss057_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss058.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss059_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue COMPILE-ARGUMENT-PROBLEMS-AGAIN Writeup</H2>
<PRE><B>Issue:</B> <A HREF="iss058.htm">COMPILE-ARGUMENT-PROBLEMS-AGAIN</A><P>
<B>References:</B> COMPILE-ARGUMENT-PROBLEMS, draft 10.156 p.3-52<P>
<B>Category:</B> CHANGE<P>
<B>Edit History:</B> 9-Dec-91, Version 1, by Moon<P>
<B>Status:</B> Passed 10-Dec-91; 11-0 on part 1, 9-1-1 on part 2<P>
<P>
<B>Problem Description:<P>
</B><P>
Cleanup COMPILE-ARGUMENT-PROBLEMS:CLARIFY created a couple of problems:<P>
<P>
(1) It says &quot;The consequences of calling <A REL=DEFINITION HREF="../Body/f_cmp.htm#compile"><B>COMPILE</B></A> on a function that is already<P>
compiled are unspecified&quot; but the spec doesn't <A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>provide</B></A> any way to create a<P>
function that is guaranteed not to be compiled already. In fact the example<P>
at the top of page 3-52 is invalid because of this.<P>
<P>
(2) It says the consequences are undefined &quot;if the function to be compiled was<P>
defined interpretively in a non-null lexical environment&quot;, but a non-null<P>
lexical environment doesn't imply a closure. It might just have declarations in<P>
it. The original motivation was &quot;Many implementations cannot correctly compile<P>
functions that are defined interpretively in a non-null lexical environment,<P>
because the compiler and interpreter use different representations for<P>
closures.&quot;<P>
<P>
<B>Proposal (COMPILE-ARGUMENT-PROBLEMS-AGAIN:FIX):<P>
</B><P>
(1) Remove the quoted text and specify that <A REL=DEFINITION HREF="../Body/f_cmp.htm#compile"><B>COMPILE</B></A> either returns the function<P>
it is given or returns an equivalent function, but in any case returns a<P>
<A REL=DEFINITION HREF="../Body/t_cmpd_f.htm#compiled-function"><B>COMPILED-FUNCTION</B></A>.<P>
<P>
(2) Replace the quoted text with &quot;if the lexical environment surrounding the<P>
function to be compiled contains any bindings other than macros, symbol macros,<P>
or declarations&quot;.<P>
<P>
<B>Rationale:<P>
</B><P>
(1) Given a function that is already compiled, <A REL=DEFINITION HREF="../Body/f_cmp.htm#compile"><B>COMPILE</B></A> can simply return it.<P>
<P>
(2) Bindings that minimal compilation would remove shouldn't prevent <A REL=DEFINITION HREF="../Body/f_cmp.htm#compile"><B>COMPILE</B></A><P>
from working, since no closure would be required.<P>
<P>
<B>Cost to implementors:<P>
</B><P>
(1) Trivial.<P>
(2) Might <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>require</B></A> some work, depending on what the interpreter does with<P>
macros in the lexical environment of an interpreted function.<P>
<P>
<B>Cost to users:<P>
</B><P>
None. This is an upward-compatible change.<P>
<P>
<B>Benefits:<P>
</B><P>
(1) Users don't have to insert extra <A REL=DEFINITION HREF="../Body/f_cmpd_f.htm#compiled-function-p"><B>COMPILED-FUNCTION-P</B></A> checks.<P>
(2) Make the language less restrictive.<P>
<P>
<B>Discussion:<P>
</B><P>
Parts 1 and 2 should be voted separately.<P>
</PRE>
<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>