<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sat May 25 18:18:52 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-374/CLJ-374.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-374] print/read syntax for defrecords</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-374</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description></description>
                <environment></environment>
            <key id="13771">CLJ-374</key>
            <summary>print/read syntax for defrecords</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="fogus">Fogus</assignee>
                                <reporter username="importer">Assembla Importer</reporter>
                        <labels>
                    </labels>
                <created>Sat, 5 Jun 2010 11:53:00 -0500</created>
                <updated>Fri, 27 May 2011 11:14:25 -0500</updated>
                    <resolved>Fri, 27 May 2011 11:14:25 -0500</resolved>
                            <version>Release 1.3</version>
                                <fixVersion>Release 1.3</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="23999" author="importer" created="Tue, 24 Aug 2010 09:32:00 -0500"  >&lt;p&gt;Converted from &lt;a href=&quot;http://www.assembla.com/spaces/clojure/tickets/374&quot;&gt;http://www.assembla.com/spaces/clojure/tickets/374&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="24000" author="importer" created="Tue, 24 Aug 2010 09:32:00 -0500"  >&lt;p&gt;stu said: If we are going to use #=, then how about modify record to take an optional metadata map before the keyvals:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(defn record
  &quot;Construct an instance of record-type from keyvals.

   record-type is a keyword naming the record.
   keyvals can include *any* keyword/value pairs, and
   can be preceded by an optional metadata map.&quot;
  {:added &lt;span class=&quot;code-quote&quot;&gt;&quot;1.2&quot;&lt;/span&gt;}
  [record-type &amp;amp; keyvals]
  {:pre [(keyword? record-type)]}
  (let [meta (when (map? (first keyvals)) (first keyvals))
        keyvals (&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; meta (&lt;span class=&quot;code-keyword&quot;&gt;rest&lt;/span&gt; keyvals) keyvals)]
    (record-implementation-detail-multimethod record-type meta (apply hash-map keyvals))))
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;

and then the read syntax can be

&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;
#=(record :user.Foo {:some-meta 1} :a nil :c 3)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="24001" author="importer" created="Tue, 24 Aug 2010 09:32:00 -0500"  >&lt;p&gt;richhickey said: I think you need to distinguish between print and print-dup contexts. I don&apos;t like the switch-on-type-of-first-arg in general. We don&apos;t do optional args preceding variadics. Also, normally we don&apos;t see metatadata in print unless &lt;b&gt;print-meta&lt;/b&gt; is true.&lt;/p&gt;

&lt;p&gt;I think a #= ctor call works for print-dup:&lt;/p&gt;

&lt;p&gt;#=(Foo. 1 2 3 {:my :meta} {:other :field})&lt;/p&gt;

&lt;p&gt;eliding the meta and extmap when neither is present:&lt;/p&gt;

&lt;p&gt;#(Foo. 1 2 3)&lt;/p&gt;

&lt;p&gt;not sure about ordinary print yet&lt;/p&gt;</comment>
                    <comment id="24002" author="importer" created="Tue, 24 Aug 2010 09:32:00 -0500"  >&lt;p&gt;stu said: In the above, why isn&apos;t print-dup&apos;s effect recursive, e.g. &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;#=(user.Foo 1 2 3 #=(clojure.lang.PersistentArrayMap/create {:my :meta}) 
                                 #=(clojure.lang.PersistentArrayMap/create {:other :field}))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;print-dup on maps certainly behaves that way, including nested maps.&lt;/p&gt;

&lt;p&gt;Also, isn&apos;t a print-dup version that includes metadata only correct when print-meta is false?&lt;/p&gt;</comment>
                    <comment id="24003" author="importer" created="Tue, 24 Aug 2010 09:32:00 -0500"  >&lt;p&gt;stu said: Updating tickets (#370, #366, #374)&lt;/p&gt;</comment>
                    <comment id="26402" author="fogus" created="Fri, 29 Apr 2011 13:30:34 -0500"  >&lt;p&gt;Patch scoped to the discussion in this ticket and at &lt;a href=&quot;http://dev.clojure.org/display/design/defrecord+improvements&quot;&gt;http://dev.clojure.org/display/design/defrecord+improvements&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="26403" author="fogus" created="Fri, 29 Apr 2011 13:55:46 -0500"  >&lt;p&gt;Added IRecord patch file. Sorry.&lt;/p&gt;</comment>
                    <comment id="26407" author="stu" created="Fri, 29 Apr 2011 15:14:50 -0500"  >&lt;p&gt;Using primitive type hints seems to break the map-&amp;gt;Record constructor:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(defrecord Bar [^&lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt; a b])
(map-&amp;gt;Bar {:a 1 :b 2})
=&amp;gt; NullPointerException   clojure.lang.RT.longCast (RT.java:1008)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="26409" author="stu" created="Fri, 29 Apr 2011 15:21:10 -0500"  >&lt;p&gt;The patch does not address deftype. It gets (as a freebie) all the new stuff available to arbitrary Java classes, but no create method, positional fn, etc. I think we should do deftype as a separate patch.&lt;/p&gt;</comment>
                    <comment id="26411" author="fogus" created="Fri, 29 Apr 2011 15:45:01 -0500"  >&lt;p&gt;RE: longCast&lt;/p&gt;

&lt;p&gt;I will check that out.  Thanks&lt;/p&gt;

&lt;p&gt;RE: deftype&lt;/p&gt;

&lt;p&gt;deftype does get a create and getBasis method, but the create is breaking because I am assuming a record ctor.  I can fix that if we think that types should have a create that takes a map.  &lt;/p&gt;

&lt;p&gt;(deftype T &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;)&lt;br/&gt;
(user.T/getBasis)&lt;br/&gt;
;=&amp;gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;a&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;(user.T/create {:a 1})&lt;br/&gt;
;; NoSuchMethodError &lt;/p&gt;

&lt;p&gt;This is because I&apos;m building a call to the record ctor that takes metadata and an extension map.  Does it make sense to generate such a create that takes a map for types? &lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
:F&lt;/p&gt;</comment>
                    <comment id="26419" author="fogus" created="Thu, 5 May 2011 17:25:24 -0500"  >&lt;p&gt;minor fixes from last patch set.&lt;/p&gt;</comment>
                    <comment id="26420" author="richhickey" created="Fri, 6 May 2011 07:50:20 -0500"  >&lt;p&gt;deftypes shouldn&apos;t get any map-taking support as they are not mappy (mappish?). They should get positional support. defrecord and deftype stuff should go in together.&lt;/p&gt;</comment>
                    <comment id="26425" author="fogus" created="Tue, 10 May 2011 07:20:48 -0500"  >&lt;p&gt;Latest patch includes changes to support deftype literals and removal of RecordExpr.&lt;/p&gt;</comment>
                    <comment id="26458" author="redinger" created="Wed, 25 May 2011 14:25:25 -0500"  >&lt;p&gt;This patch has already been applied. Updating status of this ticket.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/clojure/clojure/commit/ac1e8ad9f182dc2e8a5254f3e4b7b77c0258353d&quot;&gt;https://github.com/clojure/clojure/commit/ac1e8ad9f182dc2e8a5254f3e4b7b77c0258353d&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10221" name="CLJ-374-defrecord-literals.patch" size="37374" author="fogus" created="Tue, 10 May 2011 07:20:48 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10007">Ok</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>stu</customfieldvalue>
                </customfieldvalues>
            </customfield>
                            </customfields>
    </item>
</channel>
</rss>