<!-- 
RSS generated by JIRA (4.4#649-r158309) at Tue May 21 03:16:33 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-848/CLJ-848.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-848] defn :or form does not warn you if you provide a vector instead of a map</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-848</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;I had a problem defining a function today, I passed :or a vector instead of a map - everything seemed to work fine but later on I got a really puzzling &quot;Null pointer exception&quot;.&lt;/p&gt;

&lt;p&gt;raek helped me debug the problem and suggested opening this ticket. I think it would be useful if an exception was thrown on the :or line unless it&apos;s given a map.&lt;/p&gt;

&lt;p&gt;Here are some examples&lt;/p&gt;

&lt;p&gt;(defn broken-example [{:keys &lt;span class=&quot;error&quot;&gt;&amp;#91;i processor&amp;#93;&lt;/span&gt;&lt;br/&gt;
                       :or &lt;span class=&quot;error&quot;&gt;&amp;#91;processor identity&amp;#93;&lt;/span&gt;}]&lt;br/&gt;
  (processor i))&lt;/p&gt;

&lt;p&gt;(defn working-example [{:keys &lt;span class=&quot;error&quot;&gt;&amp;#91;i processor&amp;#93;&lt;/span&gt;&lt;br/&gt;
                       :or {processor identity}}]&lt;br/&gt;
  (processor i))&lt;/p&gt;

&lt;p&gt;(working-example {:i 1})&lt;br/&gt;
 =&amp;gt; 1&lt;br/&gt;
(broken-example {:i 1})&lt;br/&gt;
 =&amp;gt; Null pointer exception&lt;/p&gt;

&lt;p&gt;Cheers, Dave.&lt;/p&gt;</description>
                <environment>Clojure 1.3, Emacs 23, OSX Lion</environment>
            <key id="14670">CLJ-848</key>
            <summary>defn :or form does not warn you if you provide a vector instead of a map</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="5" iconUrl="http://dev.clojure.org/jira/images/icons/priority_trivial.gif">Trivial</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="2">Declined</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="kzar">Dave Barker</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 Oct 2011 06:50:49 -0500</created>
                <updated>Tue, 25 Oct 2011 18:04:23 -0500</updated>
                    <resolved>Tue, 25 Oct 2011 18:04:23 -0500</resolved>
                            <version>Release 1.3</version>
                                <fixVersion>Approved Backlog</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="26899" author="kzar" created="Thu, 6 Oct 2011 06:51:52 -0500"  >&lt;p&gt;Apologies, I meant to tag this as a minor issue instead of a major one!&lt;/p&gt;</comment>
                    <comment id="26908" author="stu" created="Fri, 7 Oct 2011 09:39:50 -0500"  >&lt;p&gt;Since vectors are associative, maybe using vectors for :or should just work?&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;(let [{noun 0
       verb 1
       obj 2
       :or [:n :v :o]}
      [:code :is]] obj)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="27089" author="stu" created="Tue, 25 Oct 2011 18:04:23 -0500"  >&lt;p&gt;Closing this until someone wants to make a principled argument for what &lt;b&gt;should&lt;/b&gt; happen (see my previous comment)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>