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

116 lines
7.3 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 DECODE-UNIVERSAL-TIME-DAYLIGHT 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/iss097_w.htm">
<LINK REL=UP HREF="../Issues/iss098.htm">
<LINK REL=NEXT HREF="../Issues/iss099_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/iss097_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss098.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss099_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue DECODE-UNIVERSAL-TIME-DAYLIGHT Writeup</H2>
<PRE><B>Issue:</B> <A HREF="iss098.htm">DECODE-UNIVERSAL-TIME-DAYLIGHT</A><P>
<B>References:</B> <A REL=DEFINITION HREF="../Body/f_dec_un.htm#decode-universal-time"><B>DECODE-UNIVERSAL-TIME</B></A> (p445)<P>
<B>Category:</B> CLARIFICATION<P>
<B>Edit history:</B> 20-Jun-88, Version 1 by Pitman<P>
30-Sep-88, Version 2 by Masinter<P>
<P>
<B>Problem Description:<P>
</B><P>
The description of <A REL=DEFINITION HREF="../Body/f_dec_un.htm#decode-universal-time"><B>DECODE-UNIVERSAL-TIME</B></A> does not say what happens with<P>
TIME-ZONE. Since the description of <A REL=DEFINITION HREF="../Body/f_encode.htm#encode-universal-time"><B>ENCODE-UNIVERSAL-TIME</B></A> mentions that<P>
its behavior differs depending on whether a time zone is explicitly passed,<P>
some implementors may have assumed that <A REL=DEFINITION HREF="../Body/f_dec_un.htm#decode-universal-time"><B>DECODE-UNIVERSAL-TIME</B></A> should do<P>
likewise.<P>
<P>
Even if all implementations did the same thing, it should still be clarified<P>
whether an implementation were permitted to return dsp=NIL tz=n rather than<P>
dsp=T tz=n+1 for time zones in which daylight savings time was believed to<P>
be (or known to be) in effect. Currently, you cannot tell whether &quot;NIL&quot; for<P>
daylight-savings-time-p means &quot;daylight savings time is in effect&quot; or<P>
just &quot;daylight savings time is not known to not be in effect&quot;.<P>
<P>
These tools appear to be more portable than they are.<P>
<P>
<B>Proposal (DECODE-UNIVERSAL-TIME-DAYLIGHT:LIKE-ENCODE):<P>
</B><P>
Specify that, like <A REL=DEFINITION HREF="../Body/f_encode.htm#encode-universal-time"><B>ENCODE-UNIVERSAL-TIME</B></A>, <A REL=DEFINITION HREF="../Body/f_dec_un.htm#decode-universal-time"><B>DECODE-UNIVERSAL-TIME</B></A> ignores<P>
daylight savings information if a timezone is explicitly specified.<P>
<P>
<B>Rationale:<P>
</B><P>
This makes things consistent with <A REL=DEFINITION HREF="../Body/f_encode.htm#encode-universal-time"><B>ENCODE-UNIVERSAL-TIME</B></A>.<P>
<P>
<B>Test Case:<P>
</B><P>
;; ### This test case relies on time zone not changing in real<P>
;; ### time, in defiance of warning in note at bottom<P>
;; ### of p445.<P>
<P>
(<A REL=DEFINITION HREF="../Body/s_let_l.htm#letST"><B>LET*</B></A> ((HERE (<A REL=DEFINITION HREF="../Body/f_nth.htm#nth"><B>NTH</B></A> 8 (<A REL=DEFINITION HREF="../Body/m_mult_1.htm#multiple-value-list"><B>MULTIPLE-VALUE-LIST</B></A> (<A REL=DEFINITION HREF="../Body/f_get_un.htm#get-decoded-time"><B>GET-DECODED-TIME</B></A>)))) ;Time zone<P>
(RECENTLY (<A REL=DEFINITION HREF="../Body/f_get_un.htm#get-universal-time"><B>GET-UNIVERSAL-TIME</B></A>))<P>
(A (<A REL=DEFINITION HREF="../Body/f_nthcdr.htm#nthcdr"><B>NTHCDR</B></A> 7 (<A REL=DEFINITION HREF="../Body/m_mult_1.htm#multiple-value-list"><B>MULTIPLE-VALUE-LIST</B></A> (<A REL=DEFINITION HREF="../Body/f_dec_un.htm#decode-universal-time"><B>DECODE-UNIVERSAL-TIME</B></A> RECENTLY))))<P>
(B (<A REL=DEFINITION HREF="../Body/f_nthcdr.htm#nthcdr"><B>NTHCDR</B></A> 7 (<A REL=DEFINITION HREF="../Body/m_mult_1.htm#multiple-value-list"><B>MULTIPLE-VALUE-LIST</B></A> (<A REL=DEFINITION HREF="../Body/f_dec_un.htm#decode-universal-time"><B>DECODE-UNIVERSAL-TIME</B></A> RECENTLY HERE)))))<P>
(<A REL=DEFINITION HREF="../Body/a_list.htm#list"><B>LIST</B></A> A B (<A REL=DEFINITION HREF="../Body/f_equal.htm#equal"><B>EQUAL</B></A> A B)))<P>
<P>
Under this proposal, this would return ((T 5) (<A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A> 5) <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>) in EDT, for example. <P>
<P>
<B>Current Practice:<P>
</B><P>
Symbolics Genera, Symbolics Cloe, Lucid 3.0 and Envos Medley seem to <P>
implement this proposal. Some other implementations do not.<P>
<P>
<B>Cost to Implementors:<P>
</B><P>
The cost of changing this should be trivial.<P>
<P>
<B>Cost to Users:<P>
</B><P>
This feature is already not well-defined since no portable program can rely<P>
on the current behavior, so the cost is small.<P>
<P>
<B>Cost of Non-Adoption:<P>
</B><P>
The time primitives are considerably less useful if this point is not<P>
clearly spelled out.<P>
<P>
<B>Benefits:<P>
</B><P>
The cost of non-adoption would be avoided.<P>
<P>
<B>Aesthetics:<P>
</B><P>
Anything that improves the intelligibility of language primitives improves<P>
language aesthetics.<P>
<P>
<B>Discussion:<P>
</B><P>
An alternative would be to specify that, unlike <A REL=DEFINITION HREF="../Body/f_encode.htm#encode-universal-time"><B>ENCODE-UNIVERSAL-TIME</B></A>,<P>
<A REL=DEFINITION HREF="../Body/f_dec_un.htm#decode-universal-time"><B>DECODE-UNIVERSAL-TIME</B></A> treats daylight savings information the same<P>
regardless of whether a time zone argument is explicitly or not. This seems <P>
actually to be what was intended originally.<P>
<P>
This problem arose while trying to port Macsyma between different<P>
Common Lisp implementations. The cleanup committee does not have<P>
a strong opinion on this matter, as long as the behavior is specified.<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>