1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Issues/iss129_w.htm

151 lines
7.6 KiB
HTML
Raw Normal View History

2024-04-01 10:24:07 +02:00
<!-- 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 DESTRUCTIVE-OPERATIONS 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/iss128_w.htm">
<LINK REL=UP HREF="../Issues/iss129.htm">
<LINK REL=NEXT HREF="../Issues/iss130_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/iss128_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss129.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss130_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue DESTRUCTIVE-OPERATIONS Writeup</H2>
<PRE><B>Forum:</B> Public Review<P>
<B>Issue:</B> <A HREF="iss129.htm">DESTRUCTIVE-OPERATIONS</A><P>
<B>References:</B> Dalton's public review comment #5 (X3J13/92-2005)<P>
Section 3.1.2.1.3 (Self-Evaluating Objects), p 3-9<P>
<A REL=DEFINITION HREF="../Body/s_quote.htm#quote"><B>QUOTE</B></A>, p 3-65<P>
<B>Category:</B> CLARIFICATION<P>
<B>Edit history:</B> 30 Dec 1992, Version 1 by Loosemore<P>
<B>Status:</B> Proposal SPECIFY passed (7+4)-1 on letter ballot 93-306<P>
<P>
<P>
<B>Problem description:<P>
</B><P>
Section 3.1.2.1.3 (Self-evaluating objects) states that the<P>
&quot;consequences are undefined if literal objects, including<P>
self-evaluating objects, are destructively modified. A<P>
similar rule appears on p. 3-65 in the description of <A REL=DEFINITION HREF="../Body/s_quote.htm#quote"><B>QUOTE</B></A>.<P>
<P>
What counts as part of such an object for the purposes of this<P>
rule and consequently cannot be modified?<P>
<P>
It is important to resolve this, because users do such things<P>
as put hash table literals in code and then add new key-value<P>
associations. It is not clear whether or not this is permitted.<P>
It is not even clear whether a symbol's property list counts as<P>
part of the symbol for the purposes of this rule.<P>
<P>
Other places in the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A> that refer to limitations on destructive <P>
operations (such as sections 3.6 and 3.7, or the discussion of<P>
compiler-macros), are similarly vague about exactly which operations<P>
are considered &quot;destructive&quot;.<P>
<P>
<P>
<B>Proposal (DESTRUCTIVE-OPERATIONS:SPECIFY):<P>
</B><P>
Specify that the following operations are considered destructive:<P>
<P>
<A REL=DEFINITION HREF="../Body/t_rnd_st.htm#random-state"><B>random-state</B></A><P>
Using it as an argument to the function <A REL=DEFINITION HREF="../Body/f_random.htm#random"><B>RANDOM</B></A>.<P>
<P>
cons<P>
Altering or destructively modifying the <A REL=DEFINITION HREF="../Body/f_car_c.htm#car"><B>CAR</B></A> or <A REL=DEFINITION HREF="../Body/f_car_c.htm#cdr"><B>CDR</B></A> of the cons.<P>
<P>
array<P>
Altering or destructively modifying any array element;<P>
changing the fill pointer, dimensions, or displacement of<P>
the array (regardless of whether the array is actually adjustable);<P>
or altering the contents of any array that is displaced to this array<P>
or that otherwise shares its contents with this array.<P>
<P>
<A REL=DEFINITION HREF="../Body/t_hash_t.htm#hash-table"><B>hash-table</B></A><P>
Altering or destructively modifying any key or its corresponding<P>
value, or adding or removing entries from the hash table.<P>
<P>
<A REL=DEFINITION HREF="../Body/t_stu_ob.htm#structure-object"><B>structure-object</B></A><P>
Altering or destructively modifying the contents of any slot.<P>
<P>
<A REL=DEFINITION HREF="../Body/t_std_ob.htm#standard-object"><B>standard-object</B></A><P>
Altering or destructively modifying the contents of any slot, or<P>
changing the <A REL=DEFINITION HREF="../Body/t_class.htm#class"><B>class</B></A> of the object.<P>
<P>
<A REL=DEFINITION HREF="../Body/t_rdtabl.htm#readtable"><B>readtable</B></A><P>
Altering the readtable-case; altering the syntax type of any<P>
character in this readtable; altering the reader macro function<P>
associated with any character in this readtable; or altering the<P>
reader macro functions associated with characters defined as <P>
dispatching macro characters in this <A REL=DEFINITION HREF="../Body/t_rdtabl.htm#readtable"><B>readtable</B></A>.<P>
<P>
stream<P>
Performing I/O operations on the stream, or closing the stream.<P>
<P>
all other types<P>
(including <A REL=DEFINITION HREF="../Body/t_number.htm#number"><B>number</B></A>, <A REL=DEFINITION HREF="../Body/a_ch.htm#character"><B>character</B></A>, <A REL=DEFINITION HREF="../Body/t_symbol.htm#symbol"><B>symbol</B></A>, <A REL=DEFINITION HREF="../Body/t_pkg.htm#package"><B>package</B></A>, <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A>, <A REL=DEFINITION HREF="../Body/a_fn.htm#function"><B>function</B></A>,<P>
<A REL=DEFINITION HREF="../Body/t_method.htm#method"><B>method</B></A>, <A REL=DEFINITION HREF="../Body/a_method.htm#method-combination"><B>method-combination</B></A>, <A REL=DEFINITION HREF="../Body/e_cnd.htm#condition"><B>condition</B></A>, <A REL=DEFINITION HREF="../Body/t_rst.htm#restart"><B>restart</B></A>)<P>
There are no destructive operations defined on these data types.<P>
<P>
<P>
<B>Rationale:<P>
</B><P>
It solves the problem in a way that is generally consistent with <P>
what is considered to be a component of an object for the purposes<P>
of determining similarity of constants.<P>
<P>
<P>
<B>Current practice:<P>
</B><P>
Unknown.<P>
<P>
<P>
<B>Cost to implementors:<P>
</B><P>
Unknown.<P>
<P>
<P>
<B>Cost to users:<P>
</B><P>
Unknown.<P>
<P>
<P>
<B>Aesthetics:<P>
</B><P>
Specifying this behavior is more aesthetic than leaving it vague.<P>
<P>
<P>
<B>Editorial impact:<P>
</B><P>
Probably the easiest way to handle this is to add a new subsection<P>
to section 3.7 containing the list above, and add appropriate references<P>
(e.g., in the glossary entry for &quot;destructive&quot;).<P>
<P>
<P>
<B>Discussion:<P>
</B><P>
<P>
<P>
<P>
<P>
<P>
<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>