<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On 2009-10-14, at 10:55 , Tim Bradshaw wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On 13 Oct 2009, at 16:43, Daniel Weinreb wrote:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> <blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">There are two separate questions here: what is the</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">definition of the Common Lisp language, and what</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">should CCL do?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Regarding the former, I think I can say pretty reliably</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">that during the design of CL, nobody thought about</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">this.<span class="Apple-converted-space"> </span>So the spec is not written in such a way as to</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">give unambiguous guidance about what these forms</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">ought to do.</div> </blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I agree with this.<span class="Apple-converted-space"> </span>However I think it's clear that, if they had <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">thought about it, they would not have mandated the kind of obscure <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">accidental name-capture that CCL does (and which other implementations <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">may well do as well), if only because it would give the hygienic macro <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">people cause to poke fun at CL.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I think one could argue from this text: "The slot default init forms <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">are evaluated in the lexical environment in which the defstruct form <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">itself appears and in the dynamic environment in which the call to the <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">constructor function appears." that CCL (and some other <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">implementations) are wrong.<span class="Apple-converted-space"> </span>However this is not clear enough since <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">"the defstruct form" needs to be something like "the defstruct form <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">which introduces the init form".</div></blockquote><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">i do not read the spec to bear this out. while the passage with respect to default initargs in 7.1.3 does extend this environment's description, as in:</span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"> The default value </span></font><a href="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#form"><font color="#001fde" style="color: #001fde"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">form</span></font></font></a><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"> is evaluated in the lexical environment of the </span></font><a href="http://www.lispworks.com/documentation/HyperSpec/Body/m_defcla.htm#defclass"><font color="#391974" style="color: #391974"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">defclass</span></font></font></a><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"> form that supplied it.</span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">this passage is part of a separate text which discusses the interpretation of the default initargs, and does not benefit from being in the context of a specification for the interpretation of a particular definition form. the analogous passage in the specification of the defclass operator does not qualify the specification. that is, it suffices with the designation "the defclass form". <span class="Apple-style-span" style="font-size: medium; ">i cannot recall any occasion to have wondered if i should even consider this to refer to anything other than the lexical context of the respective base class definition form.</span></span></font></div><div><font class="Apple-style-span" face="Times" size="4"><span class="Apple-style-span" style="font-size: 16px;"><font class="Apple-style-span" face="Monaco"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></span></font><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> <blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">In a case like that, the CCL maintainers have to</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">give some consideration to the question of</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">whether introducing a new behavior that is</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">not consonant with other CL implementations</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">may be a drawback of a proposed change (to</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">be weighed among all the pros and cons).</div> </blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I also agree with this.<span class="Apple-converted-space"> </span>However I suspect strongly that the number of <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">instances of code which defines structures which include other <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">structures, which have init forms which capture names like this, *and* <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">where the included structure was defined in a non-empty lexical <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">environment is zero.<span class="Apple-converted-space"> </span>So the change would not affect any code.</div></blockquote><div><br></div>you understate your argument. if one were to entertain to permit this, one risks promoting tolerance for the insidious in dynamic languages, cf. ruby.</div><div><br><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On the other hand the same argument says that this is fixing a problem <span class="Apple-converted-space"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">which never affects any code, so why do it?</div></blockquote><div><br></div>because one should be able to expect expressions in the language to specify coherent behavior.</div><div><br></div></body></html>