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

165 lines
11 KiB
HTML
Raw Permalink 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 SLOT-VALUE-METACLASSES 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/iss319_w.htm">
<LINK REL=UP HREF="../Issues/iss320.htm">
<LINK REL=NEXT HREF="../Issues/iss321_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/iss319_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss320.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss321_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue SLOT-VALUE-METACLASSES Writeup</H2>
<PRE><B>Issue:</B> <A HREF="iss320.htm">SLOT-VALUE-METACLASSES</A><P>
<B>References:</B> <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A> (CLOS chapter 2)<P>
<A REL=DEFINITION HREF="../Body/f_slt_un.htm#slot-unbound"><B>SLOT-UNBOUND</B></A><P>
<A REL=DEFINITION HREF="../Body/f_slt_ma.htm#slot-makunbound"><B>SLOT-MAKUNBOUND</B></A><P>
<A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A><P>
<A REL=DEFINITION HREF="../Body/f_slt_ex.htm#slot-exists-p"><B>SLOT-EXISTS-P</B></A><P>
Related issues: Issue <A HREF="iss049.htm">CLOS-CONDITIONS</A><P>
Issue <A HREF="iss048.htm">CLOS-CONDITIONS-AGAIN</A><P>
<B>Category:</B> CLARIFICATION, CHANGE<P>
<B>Edit history:</B> V1, 09 May 90, Sandra Loosemore<P>
V2, 13 May 90, Sandra Loosemore (update discussion)<P>
V3, 29 May 90, Sandra Loosemore (clean up)<P>
V4, 1 Jun 90, Gabriel (only proposal SPECIFY)<P>
V5, 06 Jun 90, Sandra Loosemore (three proposals)<P>
V6, 11 Mar 91, Sandra Loosemore (one proposal)<P>
V7, 26 Mar 91, Sandra Loosemore (amendment from meeting)<P>
<B>Status:</B> V7 (proposal LESS-MINIMAL) accepted by X3J13, Mar 1991<P>
<P>
<P>
<B>Problem description:<P>
</B><P>
The description of the function <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A> in CLOS chapter 2<P>
requires it to be implemented using SLOT-VALUE-USING-CLASS, which<P>
is not defined in the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A>. Because of this omission, it is<P>
not clear on what metaclasses <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A> is defined.<P>
<P>
There are similar problems with the description of <A REL=DEFINITION HREF="../Body/f_slt_un.htm#slot-unbound"><B>SLOT-UNBOUND</B></A><P>
(references SLOT-VALUE-USING-CLASS), <A REL=DEFINITION HREF="../Body/f_slt_ma.htm#slot-makunbound"><B>SLOT-MAKUNBOUND</B></A> (references<P>
SLOT-MAKUNBOUND-USING-CLASS), <A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A> (references <P>
SLOT-BOUNDP-USING-CLASS) and <A REL=DEFINITION HREF="../Body/f_slt_ex.htm#slot-exists-p"><B>SLOT-EXISTS-P</B></A> (references <P>
SLOT-EXISTS-P-USING-CLASS, which is not even in the current MOP<P>
draft).<P>
<P>
It is stated in CLOS chapter 2 (in the section &quot;Integrating Types <P>
and Classes&quot;) that calling <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A> on an instance of a built-in <P>
<A REL=DEFINITION HREF="../Body/t_class.htm#class"><B>class</B></A> signals an error, but nothing is said here about the other <P>
functions.<P>
<P>
<P>
<B>Proposal (SLOT-VALUE-METACLASSES:LESS-MINIMAL):<P>
</B><P>
(1) Remove references to SLOT-VALUE-USING-CLASS, <P>
SLOT-MAKUNBOUND-USING-CLASS, SLOT-BOUNDP-USING-CLASS, and <P>
SLOT-EXISTS-P-USING-CLASS from the language specification. Add<P>
implementation notes to the description of <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A>, <A REL=DEFINITION HREF="../Body/f_slt_un.htm#slot-unbound"><B>SLOT-UNBOUND</B></A>,<P>
<A REL=DEFINITION HREF="../Body/f_slt_ma.htm#slot-makunbound"><B>SLOT-MAKUNBOUND</B></A>, <A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A>, and <A REL=DEFINITION HREF="../Body/f_slt_ex.htm#slot-exists-p"><B>SLOT-EXISTS-P</B></A> which reference<P>
the corresponding functions in the metaobject protocol document.<P>
<P>
(2) Clarify that the function <A REL=DEFINITION HREF="../Body/f_slt_ex.htm#slot-exists-p"><B>SLOT-EXISTS-P</B></A> may be called with any<P>
object as its first argument, returning true if the object has a <P>
slot of the given name and false otherwise.<P>
<P>
(3) Clarify that the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A> defines the behavior of <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A>, <A REL=DEFINITION HREF="../Body/a_setf.htm#setf"><B>SETF</B></A> of<P>
<A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A>, <A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A>, and <A REL=DEFINITION HREF="../Body/f_slt_ma.htm#slot-makunbound"><B>SLOT-MAKUNBOUND</B></A> according to<P>
the metaclass of their first argument, as follows:<P>
<A REL=DEFINITION HREF="../Body/t_std_cl.htm#standard-class"><B>STANDARD-CLASS</B></A> -- all four functions work as already specified.<P>
<A REL=DEFINITION HREF="../Body/t_built_.htm#built-in-class"><B>BUILT-IN-CLASS</B></A> -- all four functions signal an error.<P>
<P>
(4) Specify that the consequences are unspecified if any of the functions<P>
<A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A>, <A REL=DEFINITION HREF="../Body/a_setf.htm#setf"><B>SETF</B></A> of <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A>, <A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A>, or <A REL=DEFINITION HREF="../Body/f_slt_ma.htm#slot-makunbound"><B>SLOT-MAKUNBOUND</B></A> are<P>
called on objects of any metaclass other than <A REL=DEFINITION HREF="../Body/t_std_cl.htm#standard-class"><B>STANDARD-CLASS</B></A> or<P>
<A REL=DEFINITION HREF="../Body/t_built_.htm#built-in-class"><B>BUILT-IN-CLASS</B></A>. An error might be signaled in this situation. Note<P>
in particular that the behavior of these functions on condition<P>
objects and objects of metaclass <A REL=DEFINITION HREF="../Body/t_stu_cl.htm#structure-class"><B>STRUCTURE-CLASS</B></A> is unspecified.<P>
<P>
Rationale for proposal LESS-MINIMAL:<P>
<P>
Point by point:<P>
<P>
(1) This gets rid of dangling pointers into hyperspace.<P>
<P>
(2) This corresponds to the current MOP draft. It is also just what<P>
88-002R would say if the remark mentioning SLOT-EXISTS-P-USING-CLASS<P>
were removed.<P>
<P>
(3) This is clearly the &quot;right&quot; behavior.<P>
<P>
(4) This constrains <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A> and friends from causing &quot;crash and burn&quot;<P>
errors, but doesn't overconstrain implementors.<P>
<P>
<B>Current Practice:<P>
</B><P>
I don't know.<P>
<P>
<B>Cost to Implementors:<P>
</B><P>
Probably small for any of the proposals.<P>
<P>
<B>Cost to Users:<P>
</B><P>
Probably none.<P>
<P>
<B>Cost of non-adoption:<P>
</B><P>
Part of the language specification will be left vague and<P>
confusing.<P>
<P>
<B>Performance impact:<P>
</B><P>
None.<P>
<P>
<B>Benefits:<P>
</B><P>
The language specification is made more concise.<P>
<P>
<B>Esthetics:<P>
</B><P>
Making this point clear would be an improvement over leaving<P>
it unspecified.<P>
<P>
<B>Discussion:<P>
</B><P>
This writeup has undergone a lot of revision because both the MOP <P>
document and people's perceptions of it have also been undergoing change.<P>
It has been difficult to find a balance between not permitting &quot;crash <P>
and burn&quot; errors and giving implementations freedom to support <P>
additional behaviors via the MOP.<P>
<P>
Gregor says:<P>
<P>
The MOP draft says very little about <A REL=DEFINITION HREF="../Body/t_stu_cl.htm#structure-class"><B>STRUCTURE-CLASS</B></A>. What it used to<P>
say about <A REL=DEFINITION HREF="../Body/t_stu_cl.htm#structure-class"><B>STRUCTURE-CLASS</B></A> was removed in response to concern that it<P>
would make it more difficult to build delivery systems (a concern which<P>
I don't share by the way). But, one thing the current draft does say is<P>
that <A REL=DEFINITION HREF="../Body/f_slt_ex.htm#slot-exists-p"><B>SLOT-EXISTS-P</B></A> won't ever signal an error.<P>
<P>
I guess my suggestion for X3J13 would be to be compatible with the MOP<P>
draft on <A REL=DEFINITION HREF="../Body/f_slt_ex.htm#slot-exists-p"><B>SLOT-EXISTS-P</B></A> and &quot;allow implementations to extend&quot; what<P>
happens when the slot-xxx functions are called on <A REL=DEFINITION HREF="../Body/f_docume.htm#structure"><B>structure</B></A> and built-in<P>
instances.<P>
<P>
It's assumed that, for item (1), the editor will make the implementation<P>
notes say something that agrees with the current MOP document.<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>