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

96 lines
7.3 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 PARSE-ERROR-STREAM 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/iss254_w.htm">
<LINK REL=UP HREF="../Issues/iss255.htm">
<LINK REL=NEXT HREF="../Issues/iss256_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/iss254_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss255.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss256_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue PARSE-ERROR-STREAM Writeup</H2>
<PRE><B>Status:</B> Version 3 passed, 6/8/90<P>
<P>
<B>Issue:</B> <A HREF="iss255.htm">PARSE-ERROR-STREAM</A><P>
<B>Forum:</B> Cleanup<P>
<B>References:</B> Condition System, Version 18<P>
Issue <A REL=DEFINITION HREF="../Body/e_rder_e.htm#reader-error"><B>READER-ERROR</B></A><P>
Issue <A HREF="iss049.htm">CLOS-CONDITIONS</A><P>
<B>Category:</B> CHANGE/CLARIFICATION<P>
<B>Edit History:</B> Version 1, 1/3/90 by Kim A. Barrett<P>
Version 2, 6/6/90 by Kim A. Barrett<P>
Version 3, 6/11/90 by Kim A. Barrett (X3J13 ammendments)<P>
<P>
<B>Problem Description:<P>
</B> The recently passed issue <A REL=DEFINITION HREF="../Body/e_rder_e.htm#reader-error"><B>READER-ERROR</B></A> defined the new condition type<P>
<A REL=DEFINITION HREF="../Body/e_parse_.htm#parse-error"><B>PARSE-ERROR</B></A> as a subtype of <A REL=DEFINITION HREF="../Body/e_stm_er.htm#stream-error"><B>STREAM-ERROR</B></A>. This means that <A REL=DEFINITION HREF="../Body/e_parse_.htm#parse-error"><B>PARSE-ERROR</B></A><P>
inherits behavior on the function <A REL=DEFINITION HREF="../Body/f_stm_er.htm#stream-error-stream"><B>STREAM-ERROR-STREAM</B></A>, and has :STREAM as<P>
the associated initarg. The description of <A REL=DEFINITION HREF="../Body/e_stm_er.htm#stream-error"><B>STREAM-ERROR</B></A> can be read to<P>
imply that the value of <A REL=DEFINITION HREF="../Body/f_stm_er.htm#stream-error-stream"><B>STREAM-ERROR-STREAM</B></A> is in fact a <A REL=DEFINITION HREF="../Body/t_stream.htm#stream"><B>STREAM</B></A>. That is,<P>
that (<A REL=DEFINITION HREF="../Body/f_typep.htm#typep"><B>TYPEP</B></A> (<A REL=DEFINITION HREF="../Body/f_stm_er.htm#stream-error-stream"><B>STREAM-ERROR-STREAM</B></A> c) '<A REL=DEFINITION HREF="../Body/t_stream.htm#stream"><B>STREAM</B></A>) -&gt; true. However, it is fairly<P>
easy to imagine a program which might want to signal <A REL=DEFINITION HREF="../Body/e_parse_.htm#parse-error"><B>PARSE-ERROR</B></A> under some<P>
circumstance, but which is not using a Common Lisp stream as its source of<P>
input.<P>
<P>
<B>Proposal (PARSE-ERROR-STREAM:SPLIT-TYPES):<P>
</B><P>
1. Define that <A REL=DEFINITION HREF="../Body/e_parse_.htm#parse-error"><B>PARSE-ERROR</B></A> has the <A REL=DEFINITION HREF="../Body/t_class.htm#class"><B>class</B></A> precedence list<P>
(<A REL=DEFINITION HREF="../Body/e_parse_.htm#parse-error"><B>PARSE-ERROR</B></A> <A REL=DEFINITION HREF="../Body/a_error.htm#error"><B>ERROR</B></A> <A REL=DEFINITION HREF="../Body/e_seriou.htm#serious-condition"><B>SERIOUS-CONDITION</B></A> <A REL=DEFINITION HREF="../Body/e_cnd.htm#condition"><B>CONDITION</B></A> T)<P>
thus making it no longer be a subtype of <A REL=DEFINITION HREF="../Body/e_stm_er.htm#stream-error"><B>STREAM-ERROR</B></A>.<P>
<P>
2. Define a new condition called <A REL=DEFINITION HREF="../Body/e_rder_e.htm#reader-error"><B>READER-ERROR</B></A>, with <A REL=DEFINITION HREF="../Body/t_class.htm#class"><B>class</B></A> precedence list<P>
(<A REL=DEFINITION HREF="../Body/e_rder_e.htm#reader-error"><B>READER-ERROR</B></A> <A REL=DEFINITION HREF="../Body/e_parse_.htm#parse-error"><B>PARSE-ERROR</B></A> <A REL=DEFINITION HREF="../Body/e_stm_er.htm#stream-error"><B>STREAM-ERROR</B></A> <A REL=DEFINITION HREF="../Body/a_error.htm#error"><B>ERROR</B></A> <A REL=DEFINITION HREF="../Body/e_seriou.htm#serious-condition"><B>SERIOUS-CONDITION</B></A> <A REL=DEFINITION HREF="../Body/e_cnd.htm#condition"><B>CONDITION</B></A> T).<P>
<P>
Issue <A REL=DEFINITION HREF="../Body/e_rder_e.htm#reader-error"><B>READER-ERROR</B></A> (version 3, passed 11/89) specified that the reader was to<P>
signal errors of type <A REL=DEFINITION HREF="../Body/e_parse_.htm#parse-error"><B>PARSE-ERROR</B></A> for serious conditions that relate to<P>
lexical analysis (the building and interpretation of tokens) and parsing<P>
(errors in reader macro syntax) by the Lisp reader. Change this to instead<P>
specify that the reader signals errors of type <A REL=DEFINITION HREF="../Body/e_rder_e.htm#reader-error"><B>READER-ERROR</B></A> for such<P>
situations. There are numerous places (especially in chapter 3) that would<P>
be affected.<P>
<P>
<B>Rational:<P>
</B> SPLIT-TYPES fixes the problem in the obvious way. If a program needs a<P>
condition which inherits from both is desired, such a condition can be<P>
trivially defined, since issue <A HREF="iss049.htm">CLOS-CONDITIONS</A> says that we now have<P>
multiple inheritance for conditions.<P>
<P>
<B>Current Practice:<P>
</B> <A REL=DEFINITION HREF="../Body/e_parse_.htm#parse-error"><B>PARSE-ERROR</B></A> is sufficiently new that few implementations are likely to<P>
have added it.<P>
<P>
<B>Cost to Implementors:<P>
</B> Should be trivial.<P>
<P>
<B>Cost to Users:<P>
</B> If this does not passe then some programs which might otherwise reasonably<P>
signal PARSE-ERRORs will not be able to do so.<P>
<P>
<B>Discussion:<P>
</B> Barrett supports SPLIT-TYPES. He had some qualms about the merging when<P>
he first saw the <A REL=DEFINITION HREF="../Body/e_rder_e.htm#reader-error"><B>READER-ERROR</B></A> issue, but didn't have time to think about<P>
it much before the issue was voted on.<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>