<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sat May 25 09:34:22 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CLJ-871/CLJ-871.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-871] instant literal</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-871</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;See &lt;a href=&quot;http://dev.clojure.org/pages/viewpage.action?pageId=950382&quot;&gt;http://dev.clojure.org/pages/viewpage.action?pageId=950382&lt;/a&gt; for design discussion.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14915">CLJ-871</key>
            <summary>instant literal</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="stu">Stuart Halloway</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Nov 2011 12:48:37 -0500</created>
                <updated>Fri, 1 Mar 2013 12:47:08 -0600</updated>
                    <resolved>Fri, 3 Feb 2012 09:05:21 -0600</resolved>
                                            <fixVersion>Release 1.4</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="27195" author="stu" created="Fri, 4 Nov 2011 12:59:21 -0500"  >&lt;p&gt;I have tested patch locally with no Joda, 1.6.2 Joda, and 2.0 Joda. All work as intended in simple invocations.&lt;/p&gt;

&lt;p&gt;Seeking feedback on &lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;UTC at the door. Goal is to stay out of localization business. Is that a good goal, and is that the right way to achieve it?&lt;/li&gt;
	&lt;li&gt;idiom for dynamically loading code based on whether Joda on classpath&lt;/li&gt;
	&lt;li&gt;idiom for conveying maven classpath into the ant part of the build. People using ant will have to configure path locally to include Joda.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="27196" author="hiredman" created="Fri, 4 Nov 2011 13:37:31 -0500"  >&lt;p&gt;using a bindable var for a read time setting is kind of a drag stuff like:&lt;/p&gt;

&lt;p&gt;(binding &lt;span class=&quot;error&quot;&gt;&amp;#91;*instant-reader* some-other-instant-reader&amp;#93;&lt;/span&gt;&lt;br/&gt;
  #@2011-11-04T14:42Z)&lt;/p&gt;

&lt;p&gt;will not have the desired effect, so then what are the use cases for the bindable var? should the repl bind it? should the compiler?&lt;/p&gt;</comment>
                    <comment id="27198" author="hiredman" created="Fri, 4 Nov 2011 18:47:23 -0500"  >&lt;p&gt;dates should always be read and printed as UTC&lt;/p&gt;</comment>
                    <comment id="27199" author="abrooks" created="Sat, 5 Nov 2011 09:55:26 -0500"  >&lt;p&gt;It seems like it would be nice to have time-delta literals as well. My usage cases deal more often with time-deltas applied as intervals or offsets in time. I presume the current scheme doesn&apos;t allow for that but could be adjusted. Is that outside of the scope of this discussion?&lt;/p&gt;</comment>
                    <comment id="27200" author="richhickey" created="Sun, 6 Nov 2011 10:31:33 -0600"  >&lt;p&gt;&amp;gt; UTC at the door.&lt;/p&gt;

&lt;p&gt;No. Offsets are not localization, just arithmetic.&lt;/p&gt;

&lt;p&gt;&amp;gt;idiom for dynamically loading code based on whether Joda on classpath&lt;/p&gt;

&lt;p&gt;We&apos;ll need more explicit mechanisms for determining the programmatic representation. Dynamic Joda is just to avoid Joda as hard implementation dep.&lt;/p&gt;

&lt;p&gt;&amp;gt; People using ant will have to configure path locally to include Joda.&lt;/p&gt;

&lt;p&gt;People using ant = me.&lt;/p&gt;</comment>
                    <comment id="27281" author="bsmith.occs@gmail.com" created="Sat, 12 Nov 2011 15:10:30 -0600"  >&lt;p&gt;This patch implements instant literals of the form &lt;tt&gt;#@yyyy-mm-ddThh:mm:ss.fff+hh:mm&lt;/tt&gt; using only classes available in the JRE.&lt;/p&gt;

&lt;p&gt;clojure.instant provides instant-readers producing instances of three different JDK classes. These functions accept a string representing a timestamp See (doc clojure.instant/parse-timestamp) for details. &lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;read-instant-date (java.util.Date)&lt;/li&gt;
	&lt;li&gt;read-instant-calendar (java.util.Calendar)&lt;/li&gt;
	&lt;li&gt;read-instant-timestamp (java.sql.Timestamp)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;By default &amp;#42;instant-reader&amp;#42; is bound to read-instant-date.&lt;/p&gt;

&lt;p&gt;print-method and print-dup are provided for all three types.&lt;/p&gt;

&lt;p&gt;Rough bits include:&lt;/p&gt;

&lt;p&gt;I&apos;m not yet certain about the exact public interface of clojure.instant. It&apos;s clear that read-instant-&amp;#42; need to be visible. It also seems likely that parse-timestamp and validated could usefully support alternate implementations for &amp;#42;instant-reader&amp;#42;.&lt;/p&gt;

&lt;p&gt;fixup-offset and fixup-nanos are ugly warts necessitated by Java&apos;s pathetic built-in support for dates and times (possibly exacerbated by my own misunderstandings of the same).&lt;/p&gt;

&lt;p&gt;Unit tests are very basic. For example, I&apos;m not testing validated except in the good case where everything is valid.&lt;/p&gt;

&lt;p&gt;See also &lt;a href=&quot;https://github.com/bpsm/clojure/commit/753f991151847df53d624f7c09b7113cd2321793&quot;&gt;https://github.com/bpsm/clojure/commit/753f991151847df53d624f7c09b7113cd2321793&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;I&apos;ve made a few trivial fixes to doc strings, visible &lt;a href=&quot;https://github.com/bpsm/clojure/commits/CLJ-871.1&quot;&gt;on my github branch&lt;/a&gt;. Those changes will be included when  I re-roll the patch it to incorporate any feedback.&lt;/p&gt;</comment>
                    <comment id="27285" author="stuart.sierra" created="Sun, 13 Nov 2011 18:53:03 -0600"  >&lt;p&gt;&lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-871&quot; title=&quot;instant literal&quot;&gt;&lt;del&gt;CLJ-871&lt;/del&gt;&lt;/a&gt;-data-readers-1.patch&lt;/p&gt;

&lt;p&gt;An alternative approach. The dynamic Var &lt;tt&gt;&amp;#42;data-readers&amp;#42;&lt;/tt&gt; maps keywords to reader functions, triggered by reader syntax &lt;tt&gt;#:keyword&lt;/tt&gt;. Default &lt;tt&gt;#:instant&lt;/tt&gt; reader takes a vector like &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;year month day hrs min sec ms&amp;#93;&lt;/span&gt;&lt;/tt&gt;, all components optional.&lt;/p&gt;

&lt;p&gt;Pros: No string parsing. Extensible.&lt;/p&gt;

&lt;p&gt;Cons: Clojure 1.2 used the &lt;tt&gt;#:&lt;/tt&gt; syntax to print records.&lt;/p&gt;</comment>
                    <comment id="27596" author="fogus" created="Sat, 21 Jan 2012 09:11:54 -0600"  >&lt;p&gt;Oddly, I made another case for this.  My bad.  Attached is the updated patch based off of Ben&apos;s work.  This patch is merged into the tagged literal feature as implemented in v1.4-alpha4.  I also fixed a fence-post error and very minor doc problems.  The parser currently defaults to constructing j.u.Date instances of the following form:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;date-year   = 4DIGIT
date-month      = 2DIGIT  ; 01-12
date-mday       = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31 based on
                         ; month/year
time-hour       = 2DIGIT  ; 00-23
time-minute     = 2DIGIT  ; 00-59
time-second     = 2DIGIT  ; 00-58, 00-59, 00-60 based on leap second
                         ; rules
time-secfrac    = &apos;.&apos; 1*DIGIT
time-numoffset  = (&apos;+&apos; / &apos;-&apos;) time-hour &apos;:&apos; time-minute
time-offset     = &apos;Z&apos; / time-numoffset

time-part            = time-hour [ &apos;:&apos; time-minute [ &apos;:&apos; time-second [time-secfrac] [time-offset] ] ]

timestamp       = date-year [ &apos;-&apos; date-month [ &apos;-&apos; date-mday [ &apos;T&apos; time-part ] ] ]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or in other words, &lt;a href=&quot;http://tools.ietf.org/html/rfc3339&quot;&gt;RFC 3339 &lt;/a&gt;.&lt;/p&gt;
</comment>
                    <comment id="27624" author="stuart.sierra" created="Fri, 27 Jan 2012 08:46:46 -0600"  >&lt;p&gt;2 problems:&lt;/p&gt;

&lt;p&gt;1. You can&apos;t specify an alternate &lt;tt&gt;inst&lt;/tt&gt; reader in data_readers.clj. Doing so causes an opaque error when Clojure starts. This is a flaw in &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-890&quot; title=&quot;Tagged literals in reader&quot;&gt;&lt;del&gt;CLJ-890&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2. &lt;tt&gt;&amp;#42;data-readers&amp;#42;&lt;/tt&gt; is intended to be a map of symbols to Vars, not symbols to functions. This doesn&apos;t really matter.&lt;/p&gt;</comment>
                    <comment id="27625" author="stuart.sierra" created="Fri, 27 Jan 2012 09:24:03 -0600"  >&lt;p&gt;New patch &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-871&quot; title=&quot;instant literal&quot;&gt;&lt;del&gt;CLJ-871&lt;/del&gt;&lt;/a&gt;-with-defaults.patch.&lt;/p&gt;

&lt;p&gt;Fixes problems described in previous comment by adding &lt;tt&gt;default-data-readers&lt;/tt&gt; which can be overridden by &lt;tt&gt;&amp;#42;data-readers&amp;#42;&lt;/tt&gt;. Also adds documentation for &lt;tt&gt;&amp;#42;data-readers&amp;#42;&lt;/tt&gt;.&lt;/p&gt;</comment>
                    <comment id="27640" author="steveminer@gmail.com" created="Wed, 1 Feb 2012 14:25:26 -0600"  >&lt;p&gt;divisible? and indivisible? should be normal functions, not macros.  They&apos;re used only in leap-year? &amp;#8211; it would be pretty simple to use zero? and mod? directly there.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10597" name="0871-instant-reader.patch" size="9421" author="stu" created="Fri, 4 Nov 2011 12:59:21 -0500" />
                    <attachment id="10702" name="CLJ-871-data-readers-1.patch" size="8345" author="stuart.sierra" created="Sun, 13 Nov 2011 18:53:03 -0600" />
                    <attachment id="10698" name="CLJ-871-jre-only.diff" size="17481" author="bsmith.occs@gmail.com" created="Sat, 12 Nov 2011 15:10:30 -0600" />
                    <attachment id="10790" name="CLJ-871-with-defaults.patch" size="24472" author="stuart.sierra" created="Fri, 27 Jan 2012 09:24:03 -0600" />
                    <attachment id="10783" name="CLJ-915-instant-literals.diff" size="19377" author="fogus" created="Sat, 21 Jan 2012 09:11:54 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10013">Test</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10002">Code and Test</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10003" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                <customfieldname>Waiting On</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>stuart.sierra</customfieldvalue>
                </customfieldvalues>
            </customfield>
                            </customfields>
    </item>
</channel>
</rss>