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

104 lines
6.4 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 DISASSEMBLE-SIDE-EFFECT 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/iss130_w.htm">
<LINK REL=UP HREF="../Issues/iss131.htm">
<LINK REL=NEXT HREF="../Issues/iss132_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/iss130_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss131.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss132_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue DISASSEMBLE-SIDE-EFFECT Writeup</H2>
<PRE><B>Issue:</B> <A HREF="iss131.htm">DISASSEMBLE-SIDE-EFFECT</A><P>
<B>References:</B> <A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> (p. 439), <A REL=DEFINITION HREF="../Body/f_cmp.htm#compile"><B>COMPILE</B></A> (p. 439)<P>
<B>Category:</B> CLARIFICATION<P>
<B>Edit history:</B> Version 2 by Pierson 12/30/87<P>
Version 3 by Pierson 1/21/88<P>
Version 4 by Pierson 6/10/88 correct VAX Lisp practice<P>
<B>Status:</B> Ready For Release?<P>
<P>
<B>Problem description:<P>
</B><P>
The definition of <A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> says that &quot;if the relevant function is<P>
not a compiled function, it is first compiled.&quot;. The definition of<P>
<A REL=DEFINITION HREF="../Body/f_cmp.htm#compile"><B>COMPILE</B></A> says that &quot;If name is a non-nil symbol, then the<P>
<A REL=DEFINITION HREF="../Body/t_cmpd_f.htm#compiled-function"><B>compiled-function</B></A> is installed as the global function definition of<P>
the symbol...&quot;. Several implementations have taken this to mean that<P>
if <A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> is passed a symbol which has an uncompiled function<P>
definition, then it has the side-effect of (<A REL=DEFINITION HREF="../Body/f_cmp.htm#compile"><B>COMPILE</B></A> 'symbol).<P>
<P>
<B>Proposal (DISASSEMBLE-SIDE-EFFECT:DO-NOT-INSTALL):<P>
</B><P>
Clarify that when <A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> compiles a function, it will never<P>
install the newly compiled function.<P>
<P>
<B>Test Cases/Examples:<P>
</B><P>
(<A REL=DEFINITION HREF="../Body/m_defun.htm#defun"><B>DEFUN</B></A> F (A) (<A REL=DEFINITION HREF="../Body/f_1pl_1_.htm#1PL"><B>1+</B></A> A))<P>
(<A REL=DEFINITION HREF="../Body/f_eq.htm#eq"><B>EQ</B></A> (<A REL=DEFINITION HREF="../Body/f_symb_1.htm#symbol-function"><B>SYMBOL-FUNCTION</B></A> 'F)<P>
(<A REL=DEFINITION HREF="../Body/s_progn.htm#progn"><B>PROGN</B></A> (<A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> 'F)<P>
(<A REL=DEFINITION HREF="../Body/f_symb_1.htm#symbol-function"><B>SYMBOL-FUNCTION</B></A> 'F)))<P>
<P>
This code will return T if this proposal is adopted. Some current<P>
implementations will return T, some will return <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>.<P>
<P>
<B>Rationale:<P>
</B><P>
Several current implementations of <A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> have surprising side<P>
effects, especially for new users.<P>
<P>
<B>Current practice:<P>
</B><P>
Allegro CL installs the compiled definition. Lucid, Symbolics, Xerox,<P>
VAX Lisp, and KCL don't install it.<P>
<P>
<B>Cost to Implementors:<P>
</B><P>
Some implementations will have to make a simple change.<P>
<P>
<B>Cost to Users:<P>
</B><P>
Very little. <A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> is really part of the environment and is<P>
probably not called by much, if any user code.<P>
<P>
<B>Cost of non-Adoption:<P>
</B><P>
<A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> will continue to surprise less experienced users.<P>
<P>
<B>Benefits:<P>
</B><P>
<A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> will become the predictable debugging function it was<P>
meant to be.<P>
<P>
<B>Aesthetics:<P>
</B><P>
Some who worried that <A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> was supposed to install the compiled<P>
function may find that the language has become a little cleaner.<P>
<P>
<B>Discussion:<P>
</B><P>
<A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> is an environment feature; some question has been raised<P>
as to the place and force of environment features in the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A>.<P>
However, this proposal stands if <A REL=DEFINITION HREF="../Body/f_disass.htm#disassemble"><B>DISASSEMBLE</B></A> is part of the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A><P>
language.<P>
<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>