102 lines
7.1 KiB
HTML
102 lines
7.1 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 DATA-TYPES-HIERARCHY-UNDERSPECIFIED 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/iss089_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss090.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss091_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/iss089_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss090.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss091_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue DATA-TYPES-HIERARCHY-UNDERSPECIFIED Writeup</H2>
|
|
|
|
<PRE><B>Issue:</B> <A HREF="iss090.htm">DATA-TYPES-HIERARCHY-UNDERSPECIFIED</A><P>
|
|
<P>
|
|
<B>References:</B> CLtL 33-35 (data types)<P>
|
|
CLtL 312 (<A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> :INCLUDE option)<P>
|
|
<P>
|
|
<B>Category:</B> CHANGE<P>
|
|
<P>
|
|
<B>Edit history:</B> 24-Mar-88, version 1 by Steele<P>
|
|
4-Sep-88, version 2 by X3J13 June 88<P>
|
|
<P>
|
|
<B>Problem description:<P>
|
|
</B><P>
|
|
The types <A REL=DEFINITION HREF="../Body/t_hash_t.htm#hash-table"><B>HASH-TABLE</B></A>, <A REL=DEFINITION HREF="../Body/t_rdtabl.htm#readtable"><B>READTABLE</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/t_stream.htm#stream"><B>STREAM</B></A>, and<P>
|
|
<A REL=DEFINITION HREF="../Body/t_rnd_st.htm#random-state"><B>RANDOM-STATE</B></A> currently are not required to be disjoint from <A REL=DEFINITION HREF="../Body/a_cons.htm#cons"><B>CONS</B></A>, <A REL=DEFINITION HREF="../Body/t_symbol.htm#symbol"><B>SYMBOL</B></A>,<P>
|
|
<A REL=DEFINITION HREF="../Body/t_array.htm#array"><B>ARRAY</B></A>, <A REL=DEFINITION HREF="../Body/t_number.htm#number"><B>NUMBER</B></A>, or <A REL=DEFINITION HREF="../Body/a_ch.htm#character"><B>CHARACTER</B></A>. The same is true of <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> types. With<P>
|
|
the arrival of CLOS, lack of disjointness will be inconvenient because one<P>
|
|
cannot reliably use generic function dispatch on these types.<P>
|
|
<P>
|
|
<P>
|
|
<B>Proposal (DATA-TYPES-HIERARCHY-UNDERSPECIFIED:DISJOINT):<P>
|
|
</B><P>
|
|
Remove the third and antepenultimate bulleted items from section 2.15 is<P>
|
|
CLtL and replace with the following:<P>
|
|
<P>
|
|
* The types <A REL=DEFINITION HREF="../Body/a_cons.htm#cons"><B>CONS</B></A>, <A REL=DEFINITION HREF="../Body/t_symbol.htm#symbol"><B>SYMBOL</B></A>, <A REL=DEFINITION HREF="../Body/t_array.htm#array"><B>ARRAY</B></A>, <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_hash_t.htm#hash-table"><B>HASH-TABLE</B></A>, <A REL=DEFINITION HREF="../Body/t_rdtabl.htm#readtable"><B>READTABLE</B></A>,<P>
|
|
<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/t_stream.htm#stream"><B>STREAM</B></A>, <A REL=DEFINITION HREF="../Body/t_rnd_st.htm#random-state"><B>RANDOM-STATE</B></A>, and any single other type created<P>
|
|
by <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> [or DEFCLASS] are pairwise disjoint.<P>
|
|
<P>
|
|
Also, in the discussion of the <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> :INCLUDE option, it is an error for<P>
|
|
the type given to the :INCLUDE option to be <A REL=DEFINITION HREF="../Body/a_cons.htm#cons"><B>CONS</B></A>, <A REL=DEFINITION HREF="../Body/t_symbol.htm#symbol"><B>SYMBOL</B></A>, <A REL=DEFINITION HREF="../Body/t_array.htm#array"><B>ARRAY</B></A>, <A REL=DEFINITION HREF="../Body/t_number.htm#number"><B>NUMBER</B></A>,<P>
|
|
<A REL=DEFINITION HREF="../Body/a_ch.htm#character"><B>CHARACTER</B></A>, <A REL=DEFINITION HREF="../Body/t_hash_t.htm#hash-table"><B>HASH-TABLE</B></A>, <A REL=DEFINITION HREF="../Body/t_rdtabl.htm#readtable"><B>READTABLE</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/t_stream.htm#stream"><B>STREAM</B></A>, or<P>
|
|
<A REL=DEFINITION HREF="../Body/t_rnd_st.htm#random-state"><B>RANDOM-STATE</B></A>.<P>
|
|
<P>
|
|
<B>Rationale:<P>
|
|
</B><P>
|
|
It would be useful to extend sequence functions to operate on streams<P>
|
|
or hash tables, for example, through the CLOS generic function mechanism.<P>
|
|
This is not possible under the current specification.<P>
|
|
<P>
|
|
<B>Current practice:<P>
|
|
</B><P>
|
|
Some implementations in effect use <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> to define data structures<P>
|
|
such as hash tables and random-states.<P>
|
|
<P>
|
|
<B>Cost to Implementors:<P>
|
|
</B><P>
|
|
Small or nonexistent. The main reason this disjointness was not specified<P>
|
|
in CLtL was the possibility that structures might not be easily<P>
|
|
distinguishable: a stupid concern over a slight efficiency. This<P>
|
|
implementation freedom apparently has not been exploited in practice.<P>
|
|
<P>
|
|
<B>Cost to Users:<P>
|
|
</B><P>
|
|
None.<P>
|
|
<P>
|
|
<B>Cost of non-adoption:<P>
|
|
</B><P>
|
|
CLOS will be less useful.<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B><P>
|
|
CLOS will be more useful.<P>
|
|
<P>
|
|
<B>Esthetics:<P>
|
|
</B><P>
|
|
This makes the type system simpler and easier to understand.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B><P>
|
|
This suggestion originated in the CLOS committee.<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>
|