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

122 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 COMPILE-FILE-OUTPUT-FILE-DEFAULTS 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/iss059_w.htm">
<LINK REL=UP HREF="../Issues/iss060.htm">
<LINK REL=NEXT HREF="../Issues/iss061_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/iss059_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss060.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss061_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue COMPILE-FILE-OUTPUT-FILE-DEFAULTS Writeup</H2>
<PRE><B>Forum:</B> Public Review<P>
<B>Issue:</B> <A HREF="iss060.htm">COMPILE-FILE-OUTPUT-FILE-DEFAULTS</A><P>
<B>References:</B> Loosemore's public review comment #6<P>
<A REL=DEFINITION HREF="../Body/f_cmp_fi.htm#compile-file"><B>COMPILE-FILE</B></A><P>
<A REL=DEFINITION HREF="../Body/f_cmp__1.htm#compile-file-pathname"><B>COMPILE-FILE-PATHNAME</B></A><P>
<A REL=DEFINITION HREF="../Body/f_merge_.htm#merge-pathnames"><B>MERGE-PATHNAMES</B></A><P>
<B>Category:</B> CLARIFICATION<P>
<B>Edit history:</B> 21 Dec 1992, Version 1 by Loosemore<P>
<B>Status:</B> Proposal INPUT-FILE passed 11-0 on letter ballot 93-302<P>
<P>
<P>
<B>Problem description:<P>
</B><P>
It's stated that the input-file <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A> to <A REL=DEFINITION HREF="../Body/f_cmp_fi.htm#compile-file"><B>COMPILE-FILE</B></A> is merged<P>
against <A REL=DEFINITION HREF="../Body/v_defaul.htm#STdefault-pathname-defaultsST"><B>*DEFAULT-PATHNAME-DEFAULTS*</B></A>, but nothing is said about<P>
merging of the :OUTPUT-FILE <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A> argument. <P>
<P>
Some existing Common Lisp implementations appear to merge it against <P>
the (merged) input-file <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A>, and others appear to merge it against <P>
<A REL=DEFINITION HREF="../Body/v_defaul.htm#STdefault-pathname-defaultsST"><B>*DEFAULT-PATHNAME-DEFAULTS*</B></A>. In practice, this means that users always<P>
have to do their own explicit merging before passing a <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A> as the<P>
:OUTPUT-FILE argument, which is a nuisance.<P>
<P>
The discussion of <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A> merging in CLtL (page 641 in CLtL-2)<P>
presents a general model that seems appropriate:<P>
<P>
&quot;This is especially useful for cases such as a program that has<P>
an input file and an output file.... Unspecified components of the<P>
output <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A> will come from the input <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A>, except that <P>
the type should not default not to the type of the input but to<P>
the appropriate default type for output from this program.&quot;<P>
<P>
However, this paragraph appears in a mangled form in draft 12.24<P>
(the second paragraph of the description section on page 19-35),<P>
which might be taken to imply that <A REL=DEFINITION HREF="../Body/f_merge_.htm#merge-pathnames"><B>MERGE-PATHNAMES</B></A> is supposed to<P>
automagically determine an appropriate default type.<P>
<P>
<P>
<B>Proposal (COMPILE-FILE-OUTPUT-FILE-DEFAULTS:INPUT-FILE):<P>
</B><P>
Clarify that the defaults for the output-file argument are taken <P>
from the <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A> that results from merging the specified<P>
input-file argument with <A REL=DEFINITION HREF="../Body/v_defaul.htm#STdefault-pathname-defaultsST"><B>*DEFAULT-PATHNAME-DEFAULTS*</B></A>, except that<P>
the type should to default to the appropriate default type for<P>
compiled files.<P>
<P>
Instruct the editor to fix the problem noted with the cited<P>
paragraph in the <A REL=DEFINITION HREF="../Body/f_merge_.htm#merge-pathnames"><B>MERGE-PATHNAMES</B></A> description (for example, by<P>
restoring the CLtL wording).<P>
<P>
<P>
<B>Rationale:<P>
</B><P>
This seems like the right model.<P>
<P>
<P>
<B>Current practice:<P>
</B><P>
Varies, as noted in the problem description.<P>
<P>
<P>
<B>Cost to implementors:<P>
</B><P>
Some implementations will have to change, but it's not a huge<P>
change.<P>
<P>
<P>
<B>Cost to users:<P>
</B><P>
None, since implementations already vary.<P>
<P>
<P>
<B>Aesthetics:<P>
</B><P>
Specifying this behavior is more aesthetic than leaving it <P>
unspecified.<P>
<P>
<P>
<B>Editorial impact:<P>
</B><P>
The change requires adding a sentence or two to the dictionary<P>
entry for <A REL=DEFINITION HREF="../Body/f_cmp_fi.htm#compile-file"><B>COMPILE-FILE</B></A> and replacing one paragraph in that for<P>
<A REL=DEFINITION HREF="../Body/f_merge_.htm#merge-pathnames"><B>MERGE-PATHNAMES</B></A>.<P>
<P>
<P>
<B>Discussion:<P>
</B><P>
If the issue to extend <A REL=DEFINITION HREF="../Body/f_cmp_fi.htm#compile-file"><B>COMPILE-FILE</B></A> to accept an open stream as<P>
an input-file argument passes (Pitmans' public review comment #14),<P>
obviously the input file cannot <A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>provide</B></A> any defaults if it is<P>
an open stream that cannot be coerced to a <A REL=DEFINITION HREF="../Body/a_pn.htm#pathname"><B>pathname</B></A>.<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>