102 lines
6.7 KiB
HTML
102 lines
6.7 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 SLOT-MISSING-VALUES 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/iss318_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss319.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss320_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/iss318_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss319.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss320_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue SLOT-MISSING-VALUES Writeup</H2>
|
|
|
|
<PRE><B>Issue:</B> <A HREF="iss319.htm">SLOT-MISSING-VALUES</A><P>
|
|
<P>
|
|
<B>References:</B> 88-002R p.2-78..79<P>
|
|
<P>
|
|
<B>Category:</B> CLARIFICATION<P>
|
|
<P>
|
|
<B>Edit history:</B> 29-Apr-90, Version 1 by Moon<P>
|
|
<P>
|
|
<B>Problem description:<P>
|
|
</B><P>
|
|
The document says that all values returned by a <A REL=DEFINITION HREF="../Body/f_slt_un.htm#slot-unbound"><B>SLOT-UNBOUND</B></A> or<P>
|
|
<A REL=DEFINITION HREF="../Body/f_slt_mi.htm#slot-missing"><B>SLOT-MISSING</B></A> <A REL=DEFINITION HREF="../Body/t_method.htm#method"><B>method</B></A> are returned from <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>, <A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A>, or<P>
|
|
<A REL=DEFINITION HREF="../Body/f_slt_ma.htm#slot-makunbound"><B>SLOT-MAKUNBOUND</B></A>. However, the language mandates particular values to be<P>
|
|
returned by <A REL=DEFINITION HREF="../Body/a_setf.htm#setf"><B>SETF</B></A> and by <A REL=DEFINITION HREF="../Body/f_slt_ma.htm#slot-makunbound"><B>SLOT-MAKUNBOUND</B></A>, and mandates that <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A> and<P>
|
|
<A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A> return exactly one value. If methods can change this,<P>
|
|
efficient compilation becomes very difficult.<P>
|
|
<P>
|
|
This is Symbolics issue #19.<P>
|
|
<P>
|
|
<B>Proposal (SLOT-MISSING-VALUES:SPECIFY):<P>
|
|
</B><P>
|
|
Specify exactly what is done with the values returned from a <A REL=DEFINITION HREF="../Body/f_slt_un.htm#slot-unbound"><B>SLOT-UNBOUND</B></A><P>
|
|
or <A REL=DEFINITION HREF="../Body/f_slt_mi.htm#slot-missing"><B>SLOT-MISSING</B></A> <A REL=DEFINITION HREF="../Body/t_method.htm#method"><B>method</B></A>, as follows:<P>
|
|
<P>
|
|
If the operation was <A REL=DEFINITION HREF="../Body/a_setf.htm#setf"><B>SETF</B></A> or <A REL=DEFINITION HREF="../Body/f_slt_ma.htm#slot-makunbound"><B>SLOT-MAKUNBOUND</B></A>, the values are ignored.<P>
|
|
<P>
|
|
If the operation was <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A> or <A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A>, exactly one value is<P>
|
|
returned; extra values returned by the <A REL=DEFINITION HREF="../Body/t_method.htm#method"><B>method</B></A> are ignored, and if the<P>
|
|
<A REL=DEFINITION HREF="../Body/t_method.htm#method"><B>method</B></A> returns no values, <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A> is returned.<P>
|
|
<P>
|
|
If the operation was <A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A> and the <A REL=DEFINITION HREF="../Body/t_method.htm#method"><B>method</B></A> returns a value other<P>
|
|
than <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>, <A REL=DEFINITION HREF="../Body/f_slt_bo.htm#slot-boundp"><B>SLOT-BOUNDP</B></A> might return any object other than <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A> that it can<P>
|
|
validly return; only the truth or falsity of the <A REL=DEFINITION HREF="../Body/t_method.htm#method"><B>method</B></A>'s value matters.<P>
|
|
<P>
|
|
<B>Current practice:<P>
|
|
</B><P>
|
|
It's likely that all CLOS implementations already conform to the proposal,<P>
|
|
since implementing what the document says would be extremely difficult.<P>
|
|
I have not actually tested any implementations.<P>
|
|
<P>
|
|
<B>Cost to Implementors:<P>
|
|
</B><P>
|
|
What's proposed is what's easiest to implement.<P>
|
|
<P>
|
|
<B>Cost to Users:<P>
|
|
</B><P>
|
|
None, since it's unlikely that any users would depend on being able to<P>
|
|
force <A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A> to return two values, or to force <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> to<P>
|
|
return something different from new-value.<P>
|
|
<P>
|
|
<B>Cost of non-adoption:<P>
|
|
</B><P>
|
|
CLOS will be seriously difficult to implement correctly.<P>
|
|
<P>
|
|
<B>Performance impact:<P>
|
|
</B><P>
|
|
Implementing CLOS correctly will cause a serious efficiency impact on<P>
|
|
<A REL=DEFINITION HREF="../Body/f_slt_va.htm#slot-value"><B>SLOT-VALUE</B></A> if this proposal is not adopted, since it will have to be<P>
|
|
capable of dynamically deciding at run time to return multiple values.<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B><P>
|
|
Simpler and more consistent language.<P>
|
|
<P>
|
|
<B>Esthetics:<P>
|
|
</B><P>
|
|
Simpler and more consistent language.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B><P>
|
|
None.<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>
|