1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Issues/iss299_w.htm
2024-04-01 10:24:07 +02:00

133 lines
9 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 RETURN-VALUES-UNSPECIFIED 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/iss298_w.htm">
<LINK REL=UP HREF="../Issues/iss299.htm">
<LINK REL=NEXT HREF="../Issues/iss300_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/iss298_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss299.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss300_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue RETURN-VALUES-UNSPECIFIED Writeup</H2>
<PRE><B>Issue:</B> <A HREF="iss299.htm">RETURN-VALUES-UNSPECIFIED</A><P>
<B>References:</B> <A REL=DEFINITION HREF="../Body/f_close.htm#close"><B>CLOSE</B></A> (p 332), <A REL=DEFINITION HREF="../Body/m_in_pkg.htm#in-package"><B>IN-PACKAGE</B></A> (p 183), <A REL=DEFINITION HREF="../Body/f_rn_pkg.htm#rename-package"><B>RENAME-PACKAGE</B></A> (p 184),<P>
<A REL=DEFINITION HREF="../Body/m_tracec.htm#trace"><B>TRACE</B></A> (p 440), <A REL=DEFINITION HREF="../Body/m_tracec.htm#untrace"><B>UNTRACE</B></A> (p 440), <A REL=DEFINITION HREF="../Body/f_inspec.htm#inspect"><B>INSPECT</B></A> (p 442), <P>
<A REL=DEFINITION HREF="../Body/f_set_sy.htm#set-syntax-from-char"><B>SET-SYNTAX-FROM-CHAR</B></A> (p 361),<P>
<A REL=DEFINITION HREF="../Body/s_locall.htm#locally"><B>LOCALLY</B></A> (p 156), <A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>PROVIDE</B></A> (p 188), <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>REQUIRE</B></A> (P 188)<P>
<P>
Related issues: <A HREF="iss296.htm">REQUIRE-PATHNAME-DEFAULTS</A><P>
<A HREF="iss053.htm">CLOSED-STREAM-OPERATIONS</A><P>
<B>Category:</B> CLARIFICATION<P>
<B>Edit history:</B> 26-Aug-88, Version 1 by Chapman<P>
19-Sept-88, Version 2 by Chapman<P>
6-Oct-88, Version 3 by Masinter<P>
7-Oct-88, Version 4 by Masinter<P>
26-Nov-88, Version 5 by Masinter<P>
9-Dec-88, Version 6 by Masinter<P>
<P>
<P>
<B>Problem Description:<P>
</B> <P>
The descriptions of <A REL=DEFINITION HREF="../Body/f_close.htm#close"><B>CLOSE</B></A>, <A REL=DEFINITION HREF="../Body/m_in_pkg.htm#in-package"><B>IN-PACKAGE</B></A>, <A REL=DEFINITION HREF="../Body/f_rn_pkg.htm#rename-package"><B>RENAME-PACKAGE</B></A>, <A REL=DEFINITION HREF="../Body/m_tracec.htm#trace"><B>TRACE</B></A>, <A REL=DEFINITION HREF="../Body/m_tracec.htm#untrace"><B>UNTRACE</B></A>,<P>
<A REL=DEFINITION HREF="../Body/f_inspec.htm#inspect"><B>INSPECT</B></A>, <A REL=DEFINITION HREF="../Body/f_set_sy.htm#set-syntax-from-char"><B>SET-SYNTAX-FROM-CHAR</B></A>, <A REL=DEFINITION HREF="../Body/s_locall.htm#locally"><B>LOCALLY</B></A>, <A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>PROVIDE</B></A>, and <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>REQUIRE</B></A> <P>
are not clear about the values returned from those constructs.<P>
<P>
Proposal (<A HREF="iss299.htm">RETURN-VALUES-UNSPECIFIED:SPECIFY</A>)<P>
<P>
Clarify that the return values for the listed constructs are as follows:<P>
<P>
<A REL=DEFINITION HREF="../Body/f_close.htm#close"><B>CLOSE</B></A> -- T<P>
<A REL=DEFINITION HREF="../Body/m_in_pkg.htm#in-package"><B>IN-PACKAGE</B></A> -- the new package, i.e. the value of <A REL=DEFINITION HREF="../Body/v_pkg.htm#STpackageST"><B>*PACKAGE*</B></A> after the<P>
execution of <A REL=DEFINITION HREF="../Body/m_in_pkg.htm#in-package"><B>IN-PACKAGE</B></A>.<P>
<A REL=DEFINITION HREF="../Body/f_rn_pkg.htm#rename-package"><B>RENAME-PACKAGE</B></A> -- the renamed package.<P>
<A REL=DEFINITION HREF="../Body/m_tracec.htm#trace"><B>TRACE</B></A> (when called with arguments) -- implementation-dependent.<P>
<A REL=DEFINITION HREF="../Body/m_tracec.htm#untrace"><B>UNTRACE</B></A> -- implementation-dependent.<P>
<A REL=DEFINITION HREF="../Body/f_inspec.htm#inspect"><B>INSPECT</B></A> -- implementation-dependent.<P>
<A REL=DEFINITION HREF="../Body/f_set_sy.htm#set-syntax-from-char"><B>SET-SYNTAX-FROM-CHAR</B></A> -- T<P>
<A REL=DEFINITION HREF="../Body/s_locall.htm#locally"><B>LOCALLY</B></A> -- the return values of the last form of its body, i.e. the body is<P>
surrounded by an implicit <A REL=DEFINITION HREF="../Body/s_progn.htm#progn"><B>PROGN</B></A>.<P>
<A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>PROVIDE</B></A> -- implementation-dependent.<P>
<A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>REQUIRE</B></A> -- implementation-dependent.<P>
<P>
(NB: <A REL=DEFINITION HREF="../Body/s_the.htm#the"><B>the</B></A> issue <A HREF="iss053.htm">CLOSED-STREAM-OPERATIONS</A> proposes modifying<P>
<A REL=DEFINITION HREF="../Body/s_the.htm#the"><B>the</B></A> <A REL=DEFINITION HREF="../Body/m_return.htm#return"><B>return</B></A> value of <A REL=DEFINITION HREF="../Body/f_close.htm#close"><B>CLOSE</B></A> on closed streams. The issue <P>
<A HREF="iss296.htm">REQUIRE-PATHNAME-DEFAULTS</A> proposes removing <P>
<A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>REQUIRE</B></A> <A REL=DEFINITION HREF="../Body/a_and.htm#and"><B>and</B></A> <A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>PROVIDE</B></A>. Those proposals would take <P>
priority over this one.)<P>
<P>
<B>Rationale:<P>
</B> <P>
This clarification allows users to know when they can and can not<P>
count on the values returned from these constructs. <P>
<P>
<B>Current Practice:<P>
</B><P>
Varies; the choices made here are consistent with many but<P>
not all implementations.<P>
<P>
<B>Cost to Implementors:<P>
</B> <P>
Small.<P>
<P>
<B>Benefits:<P>
</B> <P>
This clarification will assist users in writing portable code.<P>
<P>
<B>Cost to users:<P>
</B> <P>
Small; it seems unlikely that there is much code that currently<P>
depends on the return values of these functions; such code isn't<P>
portable.<P>
<P>
<B>Aesthetics:<P>
</B> <P>
Specified is better than not, when it makes sense.<P>
<P>
<B>Discussion:<P>
</B> <P>
<A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>PROVIDE</B></A> and <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>REQUIRE</B></A> are not likely to appear except in the &quot;top level&quot; of<P>
files, and so their return value is possibly moot. Another proposal would<P>
eliminate them from the language, and then their return value would definitely<P>
be moot!<P>
<P>
There is some sentiment for leaving unspecified the values of the<P>
debugging/environment features such as <A REL=DEFINITION HREF="../Body/m_tracec.htm#trace"><B>TRACE</B></A> and <A REL=DEFINITION HREF="../Body/m_tracec.htm#untrace"><B>UNTRACE</B></A>,<P>
for the same reasons that so much else of their behavior is unspecified.<P>
<P>
Notes from Oct 88 X3J13:<P>
<P>
Except for <A REL=DEFINITION HREF="../Body/s_locall.htm#locally"><B>LOCALLY</B></A>, why bother?<P>
<P>
That just causes portability problems. Don't want to leave it<P>
unspecified -unless- someone can cite a reason to do so.<P>
<P>
&quot;If many weren't defined, maybe we should leave 'em, but<P>
since nearly all -are- defined, let's just go ahead and<P>
round out the set.&quot;<P>
<P>
Most text books she's seen show <A REL=DEFINITION HREF="../Body/f_close.htm#close"><B>CLOSE</B></A> returning <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>.<P>
One text book shows it returning T.<P>
Since some people like to think of T as success and <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A><P>
as failure, maybe it should always return T.<P>
(See Issue: <A HREF="iss053.htm">CLOSED-STREAM-OPERATIONS</A>.)<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>