<!-- 
RSS generated by JIRA (4.4#649-r158309) at Thu May 23 10:38:42 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-1028/CLJ-1028.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-1028] (compile) crashes with NullPointerException if public function &apos;load&apos; is defined</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1028</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;When performing AOT compilation, if the namespace being compiled or one of the namespaces :required by it defines a public function named &apos;load&apos;, the compiler will crash with a NullPointerException.&lt;/p&gt;

&lt;p&gt;The following code demonstrates this:&lt;/p&gt;

&lt;p&gt;(ns ca.ancilla.kessler.core (:gen-class)) (defn load &lt;span class=&quot;error&quot;&gt;&amp;#91;x&amp;#93;&lt;/span&gt; x) (defn -main &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;amp; args&amp;#93;&lt;/span&gt; 0)&lt;/p&gt;

&lt;p&gt;When run directly, with &apos;clojure -m ca.ancilla.kessler.core&apos; or &apos;clojure ca/ancilla/kessler/core.clj&apos;, it runs as expected. When loaded with &apos;clojure -i&apos; and (compile)d, however, or when automatically compiled by &apos;lein run&apos;, it results in a NullPointerException (the complete stack trace is attached).&lt;/p&gt;

&lt;p&gt;This occurs whether or not &apos;load&apos; or actually called. It does not, however, occur if &apos;load&apos; is private.&lt;/p&gt;</description>
                <environment>Linux, OpenJDK 1.6.0 64bit</environment>
            <key id="15584">CLJ-1028</key>
            <summary>(compile) crashes with NullPointerException if public function &apos;load&apos; is defined</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</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="toxicfrog">Ben Kelly</reporter>
                        <labels>
                        <label>Compiler</label>
                        <label>bug</label>
                    </labels>
                <created>Fri, 20 Jul 2012 12:40:30 -0500</created>
                <updated>Fri, 20 Jul 2012 22:06:22 -0500</updated>
                    <resolved>Fri, 20 Jul 2012 16:35:47 -0500</resolved>
                            <version>Release 1.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="29007" author="toxicfrog" created="Fri, 20 Jul 2012 12:43:33 -0500"  >&lt;p&gt;If you add (:refer-clojure :exclude &lt;span class=&quot;error&quot;&gt;&amp;#91;load&amp;#93;&lt;/span&gt;) to the (ns), it works fine:&lt;/p&gt;

&lt;p&gt;(ns ca.ancilla.kessler.core (:refer-clojure :exclude &lt;span class=&quot;error&quot;&gt;&amp;#91;load&amp;#93;&lt;/span&gt;) (:gen-class))&lt;br/&gt;
(defn load &lt;span class=&quot;error&quot;&gt;&amp;#91;x&amp;#93;&lt;/span&gt; x)&lt;br/&gt;
(defn -main &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;amp; args&amp;#93;&lt;/span&gt; 0)&lt;/p&gt;

&lt;p&gt;Thanks to llasram on IRC for discovering this.&lt;/p&gt;</comment>
                    <comment id="29010" author="stu" created="Fri, 20 Jul 2012 16:35:38 -0500"  >&lt;p&gt;You should not replace functions in clojure.core.  This is left legal (with a loud CONSOLE warning) for compatibility, but programs that do it are in error.&lt;/p&gt;</comment>
                    <comment id="29015" author="toxicfrog" created="Fri, 20 Jul 2012 22:06:22 -0500"  >&lt;p&gt;So, just to make sure that I have this right, then...&lt;/p&gt;

&lt;p&gt;If I want to create a namespace with a public function that shares a name with a function in clojure.core, the only supported way of doing this is to (:refer-clojure :exclude &lt;span class=&quot;error&quot;&gt;&amp;#91;list of all such functions&amp;#93;&lt;/span&gt;)?&lt;/p&gt;

&lt;p&gt;If so, it would be nice if the warning were replaced with an error, rather than having the compiler emit an error and then &lt;b&gt;crash&lt;/b&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11391" name="stack-trace" size="1541" author="toxicfrog" created="Fri, 20 Jul 2012 12:40:30 -0500" />
                </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>