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

128 lines
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 EXTRA-RETURN-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/iss155_w.htm">
<LINK REL=UP HREF="../Issues/iss156.htm">
<LINK REL=NEXT HREF="../Issues/iss157_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/iss155_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss156.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss157_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue EXTRA-RETURN-VALUES Writeup</H2>
<PRE>Version 6 (not shown here) is what passed.<P>
It was modified by amendment to strike everything in the <P>
proposal section except for the first paragraph. <P>
v6 is the one that passed.<P>
-kmp (Aug 89)<P>
<P>
-----<P>
<B>Issue:</B> <A HREF="iss156.htm">EXTRA-RETURN-VALUES</A><P>
<B>References:</B> Chapter 1, Section 1.5, Working draft of <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A><P>
<B>Category:</B> Clarification<P>
<B>Edit history:</B> 8-JAN-89, Version 1 by Masinter<P>
3-FEB-89, Version 2 by Chapman<P>
10-MAR-89, Version 3 by Chapman<P>
30-MAY-89, Version 4 by Pierson<P>
20-JUN-89, Version 5 by Chapman<P>
<P>
<P>
Problem: Is it OK to return extra values from Common Lisp functions?<P>
<P>
Proposal: <A HREF="iss156.htm">EXTRA-RETURN-VALUES:NO</A><P>
<P>
A function that is specified by the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A> must return EXACTLY the number <P>
of return values specified by the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A>. <P>
<P>
The following functions are explicited permitted to have additional<P>
return values: <P>
<P>
<A REL=DEFINITION HREF="../Body/f_gethas.htm#gethash"><B>gethash</B></A><P>
<A REL=DEFINITION HREF="../Body/f_remhas.htm#remhash"><B>remhash</B></A><P>
<A REL=DEFINITION HREF="../Body/f_set_ma.htm#get-macro-character"><B>get-macro-character</B></A> <P>
<A REL=DEFINITION HREF="../Body/f_set__1.htm#get-dispatch-macro-character"><B>get-dispatch-macro-character</B></A><P>
read<P>
<A REL=DEFINITION HREF="../Body/f_rd_rd.htm#read-preserving-whitespace"><B>read-preserving-whitespace</B></A><P>
<A REL=DEFINITION HREF="../Body/f_rd_del.htm#read-delimited-list"><B>read-delimited-list</B></A><P>
<A REL=DEFINITION HREF="../Body/f_rd_lin.htm#read-line"><B>read-line</B></A><P>
<A REL=DEFINITION HREF="../Body/f_rd_cha.htm#read-char"><B>read-char</B></A><P>
<A REL=DEFINITION HREF="../Body/f_unrd_c.htm#unread-char"><B>unread-char</B></A><P>
<A REL=DEFINITION HREF="../Body/f_peek_c.htm#peek-char"><B>peek-char</B></A><P>
listen<P>
<A REL=DEFINITION HREF="../Body/f_rd_c_1.htm#read-char-no-hang"><B>read-char-no-hang</B></A><P>
<A REL=DEFINITION HREF="../Body/f_rd_fro.htm#read-from-string"><B>read-from-string</B></A><P>
<A REL=DEFINITION HREF="../Body/f_parse_.htm#parse-integer"><B>parse-integer</B></A><P>
<A REL=DEFINITION HREF="../Body/f_rd_by.htm#read-byte"><B>read-byte</B></A><P>
<A REL=DEFINITION HREF="../Body/f_wr_to_.htm#write-to-string"><B>write-to-string</B></A><P>
prin1-to-string<P>
<A REL=DEFINITION HREF="../Body/f_wr_to_.htm#princ-to-string"><B>princ-to-string</B></A><P>
<A REL=DEFINITION HREF="../Body/f_wr_stg.htm#write-string"><B>write-string</B></A><P>
format<P>
<A REL=DEFINITION HREF="../Body/f_y_or_n.htm#y-or-n-p"><B>y-or-n-p</B></A><P>
<A REL=DEFINITION HREF="../Body/f_y_or_n.htm#yes-or-no-p"><B>yes-or-no-p</B></A><P>
open<P>
<A REL=DEFINITION HREF="../Body/f_rn_fil.htm#rename-file"><B>rename-file</B></A><P>
<A REL=DEFINITION HREF="../Body/f_probe_.htm#probe-file"><B>probe-file</B></A><P>
directory<P>
<A REL=DEFINITION HREF="../Body/m_tracec.htm#trace"><B>trace</B></A><P>
<A REL=DEFINITION HREF="../Body/m_tracec.htm#untrace"><B>untrace</B></A><P>
<A REL=DEFINITION HREF="../Body/f_apropo.htm#apropos-list"><B>apropos-list</B></A><P>
describe <P>
<P>
<P>
<P>
<B>Rationale:<P>
</B> <P>
The reason is that additional arguments are visible to otherwise<P>
portable programs. For instance, (<A REL=DEFINITION HREF="../Body/s_multip.htm#multiple-value-call"><B>multiple-value-call</B></A> #'cons (floor x<P>
y)) looks portable, but it will try to pass the wrong number of<P>
arguments to <A REL=DEFINITION HREF="../Body/a_cons.htm#cons"><B>CONS</B></A> if <A REL=DEFINITION HREF="../Body/f_floorc.htm#floor"><B>FLOOR</B></A> returns an extra value.<P>
<P>
The order of the above list is by page number in CLtL.<P>
<P>
<B>Current Practice:<P>
</B> <P>
At least one implementation returns extra values for certain functions<P>
not currently specified to return those values.<P>
<P>
<B>Adoption Cost:<P>
</B> <P>
Implementations and their associated documentation that now contain <P>
functions that return extra values will have to change.<P>
<P>
<B>Benefits:<P>
</B> <P>
Programs will potentially become more portable.<P>
<P>
<B>Conversion Cost:<P>
</B> <P>
See Adoption Cost.<P>
<P>
<B>Aesthetics:<P>
</B> <P>
None.<P>
<P>
<B>Discussion:<P>
</B>Pierson created the original list, Moon revised the list.<P>
<P>
Moon says:<P>
&quot;The ones that I care the most about are <A REL=DEFINITION HREF="../Body/f_gethas.htm#gethash"><B>gethash</B></A> and <A REL=DEFINITION HREF="../Body/f_rd_lin.htm#read-line"><B>read-line</B></A>.&quot;<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>