109 lines
6.1 KiB
HTML
109 lines
6.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 ROOM-DEFAULT-ARGUMENT 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/iss299_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss300.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss301_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/iss299_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss300.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss301_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue ROOM-DEFAULT-ARGUMENT Writeup</H2>
|
|
|
|
<PRE><B>Issue:</B> <A HREF="iss300.htm">ROOM-DEFAULT-ARGUMENT</A><P>
|
|
<B>References:</B> <A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> (p442)<P>
|
|
<B>Category:</B> ADDITION<P>
|
|
<B>Edit history:</B> 12-Sep-88, Version 1 by Pitman<P>
|
|
<P>
|
|
<B>Problem Description:<P>
|
|
</B><P>
|
|
Passing no argument to <A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> is not equivalent to any argument which<P>
|
|
can be passed. This makes data-flow from another function which wants<P>
|
|
to call <A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> inconvenient. Rather than simply passing a value through,<P>
|
|
the correct calling sequence must be selected as well. For example,<P>
|
|
one might have to do something like<P>
|
|
(<A REL=DEFINITION HREF="../Body/m_case_.htm#case"><B>CASE</B></A> FLAG<P>
|
|
(:DEFAULT (<A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A>))<P>
|
|
((T <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>) (<A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> FLAG)))<P>
|
|
where (<A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> FLAG) would suffice<P>
|
|
<P>
|
|
<B>Proposal (ROOM-DEFAULT-ARGUMENT:NEW-VALUE):<P>
|
|
</B><P>
|
|
Specify that passing an argument of :DEFAULT is equivalent to passing<P>
|
|
no argument to <A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A>.<P>
|
|
<P>
|
|
<B>Test Case:<P>
|
|
</B><P>
|
|
(<A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> ':DEFAULT) is functionally equivalent to (<A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A>).<P>
|
|
<P>
|
|
<B>Rationale:<P>
|
|
</B><P>
|
|
Minimal change needed to get around the stated problem.<P>
|
|
<P>
|
|
Allows <A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> to be describable without reference to supplied-p<P>
|
|
information.<P>
|
|
<P>
|
|
<B>Current Practice:<P>
|
|
</B><P>
|
|
Symbolics Genera defines <A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> using <A REL=DEFINITION HREF="../Body/03_da.htm#AMrest"><B>&REST</B></A> and looks for <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>, (T), or (<A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>).<P>
|
|
[This reduces its ability to do compile-time number-of-argument checking.]<P>
|
|
<P>
|
|
Some other implementations probably have a magic undocumented value<P>
|
|
to avoid use of a SUPPLIED-P argument.<P>
|
|
<P>
|
|
<B>Cost to Implementors:<P>
|
|
</B><P>
|
|
Probably it involves negligible resources to change this.<P>
|
|
In most implementations, the resulting code would probably look better.<P>
|
|
<P>
|
|
<B>Cost to Users:<P>
|
|
</B><P>
|
|
None. This change is upward compatible.<P>
|
|
<P>
|
|
<B>Cost of Non-Adoption:<P>
|
|
</B><P>
|
|
The description of <A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> will look yucky in the emerging specification.<P>
|
|
The source code for <A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> will look yucky.<P>
|
|
[How's that for objective? -kmp]<P>
|
|
Error checking in some implementations may be sub-optimal.<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B><P>
|
|
The description of <A REL=DEFINITION HREF="../Body/f_room.htm#room"><B>ROOM</B></A> in the now-being-written specification would<P>
|
|
be less complicated.<P>
|
|
<P>
|
|
<B>Aesthetics:<P>
|
|
</B><P>
|
|
This proposal would make a minor improvement in aesthetics.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B><P>
|
|
This is obviously a low-priority issue, but would <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>require</B></A> such little<P>
|
|
resources to fix that it seems worth doing.<P>
|
|
<P>
|
|
Pitman supports this addition.<P>
|
|
<P>
|
|
It's perhaps too bad that keywords like :SHORT, :MEDIUM, and :LONG<P>
|
|
weren't chosen instead of T and <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>, since T and <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A> have a bit of a<P>
|
|
binary feel to them and it's hard to think of a good name for the<P>
|
|
default case.<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>
|