<!--
RSS generated by JIRA (4.4#649-r158309) at Wed Jun 19 00:41:00 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/sr/jira.issueviews:searchrequest-xml/10000/SearchRequest-10000.xml?tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://dev.clojure.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Vetted (Clojure JIRA)</title>
        <link>http://dev.clojure.org/jira/secure/IssueNavigator.jspa?requestId=10000</link>
        <description>Issues that have been vetted and are still open. Ready for development.</description>
                <language>en-us</language>
                        <issue start="0" end="28" total="28"/>
                <build-info>
            <version>4.4</version>
            <build-number>649</build-number>
            <build-date>25-07-2011</build-date>
        </build-info>
<item>
            <title>[CLJ-1125] Clojure can leak memory when used in a servlet container</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1125</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;When used within a servlet container&lt;br/&gt;
(Jetty/Tomcat/JBossAS/Immutant/etc), the thread locals Var.dvals (used&lt;br/&gt;
to store dynamic bindings) and LockingTransaction.transaction (used to&lt;br/&gt;
store the currently active transaction(s)) prevent all of the classes&lt;br/&gt;
loaded by an application&apos;s clojure runtime from being garbage collected, &lt;br/&gt;
resulting in a memory leak.&lt;/p&gt;

&lt;p&gt;The issue comes from threads living beyond the lifetime of a&lt;br/&gt;
deployment - servlet containers use thread pools that are shared&lt;br/&gt;
across all applications within the container. Currently, the dvals and&lt;br/&gt;
transaction thread locals are not discarded when they are no longer&lt;br/&gt;
needed, causing their contents to retain a hard reference to their&lt;br/&gt;
classloaders, which, in turn, causes all of the classes loaded under&lt;br/&gt;
the application&apos;s classloader to be retained until the thread exits&lt;br/&gt;
(which is generally at JVM shutdown).&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a patch that does the following:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Var.dvals is now removed when the thread bindings are popped&lt;/li&gt;
	&lt;li&gt;Var.dvals no longer has an initialValue, so checking to see if it is&lt;br/&gt;
  set will no longer set it to an empty Frame&lt;/li&gt;
	&lt;li&gt;The outer transaction in LockingTransaction.transaction now removes&lt;br/&gt;
  the thread local when it is finished&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There is still the opportunity for memory leaks if agents or futures &lt;br/&gt;
are used, and the executors used for them are not shutdown when the&lt;br/&gt;
app is undeployed. That&apos;s a solvable problem, but should probably be&lt;br/&gt;
solved by the containers themselves (and/or the war generation tools) &lt;br/&gt;
instead of in clojure itself.&lt;/p&gt;

&lt;p&gt;This patch has a small performance impact: its use of a try/finally &lt;br/&gt;
around running transactions to remove the outer transaction adds &lt;br/&gt;
4-6 microseconds to each transaction call on my hardware.&lt;/p&gt;

&lt;p&gt;Providing an automated test for this patch is difficult - I&apos;ve tested&lt;br/&gt;
it locally with repeated deployments to a container while monitoring&lt;br/&gt;
GC and permgen. All of clojure&apos;s tests pass with it applied.&lt;/p&gt;

&lt;p&gt;The above is a condensation of:&lt;br/&gt;
&lt;a href=&quot;https://groups.google.com/d/topic/clojure-dev/3CXDe8_9G58/discussion&quot;&gt;https://groups.google.com/d/topic/clojure-dev/3CXDe8_9G58/discussion&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;m happy to provide whatever feedback/work is needed to get this&lt;br/&gt;
applied.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15882">CLJ-1125</key>
            <summary>Clojure can leak memory when used in a servlet container</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="stu">Stuart Halloway</assignee>
                                <reporter username="tcrawley">Toby Crawley</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Dec 2012 15:01:15 -0600</created>
                <updated>Fri, 14 Jun 2013 10:56:13 -0500</updated>
                                                    <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>9</votes>
                        <watches>8</watches>
                        <comments>
                    <comment id="31088" author="trptcolin" created="Mon, 13 May 2013 19:30:16 -0500"  >&lt;p&gt;This patch works great for me to avoid OOM/PermGen crashes from classloaders being retained &lt;span class=&quot;error&quot;&gt;&amp;#91;mine is a non-servlet use case&amp;#93;&lt;/span&gt;.&lt;/p&gt;</comment>
                    <comment id="31141" author="stu" created="Fri, 24 May 2013 09:43:33 -0500"  >&lt;p&gt;Does Tomcat create warnings for Clojure, as described e.g. &lt;a href=&quot;http://stackoverflow.com/questions/5292349/is-this-very-likely-to-create-a-memory-leak-in-tomcat&quot;&gt;here&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;If so, does this patch make the warnings go away?&lt;/p&gt;</comment>
                    <comment id="31142" author="tcrawley" created="Fri, 24 May 2013 09:56:14 -0500"  >&lt;p&gt;Stu: that&apos;s a good question. I&apos;ll take a look at Tomcat this afternoon.&lt;/p&gt;</comment>
                    <comment id="31143" author="stu" created="Fri, 24 May 2013 10:04:04 -0500"  >&lt;p&gt;The code that calls transaction.remove() seems unncessarily subtle.   There are two exits from the method, and only one is protected by the finally block.&lt;/p&gt;

&lt;p&gt;If the &quot;outer&quot; case was a top-level if, the logic would be more clear, and only the &quot;outer&quot; case would need try/finally, which might reduce the performance penalty in the case of deeply nested dosyncs.&lt;/p&gt;

&lt;p&gt;Did your transaction overhead of 4-6 microseconds test only one level of dosync, or many?&lt;/p&gt;</comment>
                    <comment id="31144" author="stu" created="Fri, 24 May 2013 10:13:35 -0500"  >&lt;p&gt;Because the unwind code calls &lt;tt&gt;remove&lt;/tt&gt; at the top (as opposed to &lt;tt&gt;set(null)&lt;/tt&gt;), the code should now be safe for use with Clojure-defined &lt;tt&gt;ThreadLocal&lt;/tt&gt; subclasses.&lt;/p&gt;

&lt;p&gt;Therefore, Var&apos;s use of an &lt;tt&gt;initialValue&lt;/tt&gt; should be irrelevant to this patch, and it should be possible to fix this bug with a patch half the size of the current patch, touching only &lt;tt&gt;LockingTransaction.runInTransaction&lt;/tt&gt; and &lt;tt&gt;Var.popThreadBindings&lt;/tt&gt;.&lt;/p&gt;</comment>
                    <comment id="31263" author="tcrawley" created="Fri, 14 Jun 2013 07:38:45 -0500"  >&lt;h3&gt;&lt;a name=&quot;re%3ATomcatThreadLocalwarnings&quot;&gt;&lt;/a&gt;re: Tomcat ThreadLocal warnings&lt;/h3&gt;

&lt;p&gt;With Clojure 1.5.1 using my test app (linked below), I see:&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;Jun 14, 2013 6:35:22 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/leak] created a ThreadLocal with key of type [clojure.lang.Var$1] (value [clojure.lang.Var$1@4902919]) and a value of type [clojure.lang.Var.Frame] (value [clojure.lang.Var$Frame@147a2aa6]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jun 14, 2013 6:35:22 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/leak] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@608602ca]) and a value of type [clojure.lang.LockingTransaction] (value [clojure.lang.LockingTransaction@7e214d47]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With the original patch (threadlocal-removal-tcrawley-2012-12-11.diff) and the one attached today (threadlocal-removal-tcrawley-2013-06-14.diff), I no longer see these warnings.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;re%3Athe%7B%7BLockingTransaction.runInTransaction%7D%7Dchanges&quot;&gt;&lt;/a&gt;re: the &lt;tt&gt;LockingTransaction.runInTransaction&lt;/tt&gt; changes&lt;/h3&gt;

&lt;p&gt;In today&apos;s patch (threadlocal-removal-tcrawley-2013-06-14.diff), I modified &lt;tt&gt;runInTransaction&lt;/tt&gt; to have one exit point, and only wrap a call to &lt;tt&gt;run&lt;/tt&gt; with a try/finally in the outer transaction case. It does introduce two locations where &lt;tt&gt;run&lt;/tt&gt; can be called to preserve the case where an inner transaction has null info:&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;&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; runInTransaction(Callable fn) &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; Exception{
	LockingTransaction t = transaction.get();
        &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; ret;
	&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(t == &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
            transaction.set(t = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; LockingTransaction());
            &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
                ret = t.run(fn);
            } &lt;span class=&quot;code-keyword&quot;&gt;finally&lt;/span&gt; {
                transaction.remove();
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(t.info != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
                ret = fn.call();
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                ret = t.run(fn);
            }
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; ret;
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, this will likely not reduce the speed penalty I observed in my testing, as I was only using a single level of &lt;tt&gt;dosync&lt;/tt&gt; when capturing timing data.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;re%3Aremoving%7B%7BinitialValue%7D%7Dfrom%7B%7Bdvals%7D%7D&quot;&gt;&lt;/a&gt;re: removing &lt;tt&gt;initialValue&lt;/tt&gt; from &lt;tt&gt;dvals&lt;/tt&gt;&lt;/h3&gt;

&lt;p&gt;My original solution kept &lt;tt&gt;initialValue&lt;/tt&gt;, but I then apparently discovered cases where the leak still occurred (see the &lt;a href=&quot;https://groups.google.com/d/topic/clojure-dev/3CXDe8_9G58/discussion&quot;&gt;mailing list thread&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Unfortunately, I can neither recreate that case, nor find in my notes, test code, or the clojure code a reason why keeping &lt;tt&gt;initialValue&lt;/tt&gt; would allow the ThreadLocals to leak when &lt;tt&gt;popThreadBindings&lt;/tt&gt; is patched (assuming one doesn&apos;t call &lt;tt&gt;Var.getThreadBindings&lt;/tt&gt; from Java without calling &lt;tt&gt;Var.popThreadBindings&lt;/tt&gt;).&lt;/p&gt;

&lt;p&gt;Therefore, I&apos;ve attached a simpler patch (threadlocal-removal-tcrawley-2013-06-14.diff) that just patches &lt;tt&gt;LockingTransaction.runInTransaction&lt;/tt&gt; and &lt;tt&gt;Var.popThreadBindings&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;I&apos;ve also created a &lt;a href=&quot;https://github.com/tobias/threadlocal-leak-check&quot;&gt;project&lt;/a&gt; that demonstrates the leak with 1.5.1, and that the leak does not appear with this patch applied to 1.6.0-master. See its &lt;a href=&quot;https://github.com/tobias/threadlocal-leak-check#threadlocal-leak-check&quot;&gt;README&lt;/a&gt; for usage details.&lt;/p&gt;

&lt;p&gt;The patched version of 1.6.0-master is available as &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;org.clojars.tcrawley/clojure &amp;quot;1.6.0-clearthreadlocals&amp;quot;&amp;#93;&lt;/span&gt;&lt;/tt&gt; if anyone wants to give it a try in their own projects. Note that since its group isn&apos;t &apos;org.clojure&apos;, you may need to add exclusions to your project to prevent another version of clojure being included.&lt;/p&gt;</comment>
                    <comment id="31265" author="jafingerhut" created="Fri, 14 Jun 2013 10:56:13 -0500"  >&lt;p&gt;Presumptuously changing ticket approval from Incomplete back to its former Vetted state, since Toby&apos;s comments and new patch seem to address the comments that led Stu to change it to Incomplete.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11756" name="threadlocal-removal-tcrawley-2012-12-11.diff" size="3685" author="tcrawley" created="Tue, 11 Dec 2012 15:01:15 -0600" />
                    <attachment id="12029" name="threadlocal-removal-tcrawley-2013-06-14.diff" size="2157" author="tcrawley" created="Fri, 14 Jun 2013 07:39:16 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1184] Evaling #{do ...} or [do ...] is treated as the do special form</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1184</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Evaluating a persistent collection for which the function &apos;first&apos; returns the symbol &apos;do&apos; leads to that collection being treated as the do special form, even though it may be a vector or even a set. IMHO, the expected result would be to report that &apos;do&apos; cannot be resolved. For the cause, see the if condition on line 6604 of Compiler.java in clojure-1.5.1.&lt;/p&gt;

&lt;p&gt;E.g.:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;do 1 2&amp;#93;&lt;/span&gt;&lt;br/&gt;
;=&amp;gt; 2&lt;/p&gt;

&lt;p&gt;#{&quot;hello&quot; &quot;goodbye&quot; do}&lt;br/&gt;
;=&amp;gt; &quot;hello&quot;&lt;br/&gt;
; Wat?&lt;/p&gt;</description>
                <environment></environment>
            <key id="16093">CLJ-1184</key>
            <summary>Evaling #{do ...} or [do ...] is treated as the do special form</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="5" iconUrl="http://dev.clojure.org/jira/images/icons/priority_trivial.gif">Trivial</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="jirkamarsik">Ji&#345;&#237; Mar&#353;&#237;k</reporter>
                        <labels>
                        <label>Compiler</label>
                        <label>bug</label>
                    </labels>
                <created>Sat, 16 Mar 2013 08:56:32 -0500</created>
                <updated>Sun, 9 Jun 2013 16:31:55 -0500</updated>
                                    <version>Release 1.5</version>
                                <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="31169" author="gfredericks" created="Sun, 26 May 2013 14:13:28 -0500"  >&lt;p&gt;Attached a patch that changes IPersistentCollection to ISeq on the referenced line, and a regression test.&lt;/p&gt;</comment>
                    <comment id="31236" author="bronsa" created="Sun, 9 Jun 2013 14:52:11 -0500"  >&lt;p&gt;As found out on #clojure, there are still some cases where the symbol &quot;do&quot; behaves in unexpected ways that this patch doesn&apos;t address.&lt;/p&gt;

&lt;p&gt;user=&amp;gt; ((fn &lt;span class=&quot;error&quot;&gt;&amp;#91;do&amp;#93;&lt;/span&gt; do) 1)&lt;br/&gt;
nil&lt;br/&gt;
user=&amp;gt; (let &lt;span class=&quot;error&quot;&gt;&amp;#91;do 1&amp;#93;&lt;/span&gt; do)&lt;br/&gt;
nil&lt;/p&gt;</comment>
                    <comment id="31237" author="gfredericks" created="Sun, 9 Jun 2013 15:00:21 -0500"  >&lt;p&gt;Presumably the same issue is the difference between&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;(let [x 5] &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; x)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which returns &lt;tt&gt;5&lt;/tt&gt; and&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;(let [x 5] &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; x)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt; which gives a compile error.&lt;/p&gt;</comment>
                    <comment id="31239" author="bronsa" created="Sun, 9 Jun 2013 16:31:55 -0500"  >&lt;p&gt;This is actually a different bug.&lt;br/&gt;
I created another ticket with patch+test see &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1216&quot;&gt;http://dev.clojure.org/jira/browse/CLJ-1216&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="12015" name="CLJ-1184-p1.patch" size="1676" author="gfredericks" created="Sun, 26 May 2013 14:13:28 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1083] Incorrect ArityException message for function names containing -&gt;</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1083</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;user=&amp;gt; (defn a-&amp;gt;b [])&lt;br/&gt;
#&apos;user/a-&amp;gt;b&lt;br/&gt;
user=&amp;gt; (a-&amp;gt;b 1)&lt;br/&gt;
ArityException Wrong number of args (1) passed to: user$a  clojure.lang.AFn.throwArity (AFn.java:437)&lt;/p&gt;

&lt;p&gt;Note that the reported function name in the stack trace is &quot;user$a&quot;, where it should be &quot;user$a-&amp;gt;b&quot; (or some mangled variant thereof?)&lt;/p&gt;

&lt;p&gt;See discussion here: &lt;a href=&quot;https://groups.google.com/d/msg/clojure/PVNoLclhhB0/_NWqyE0cPAUJ&quot;&gt;https://groups.google.com/d/msg/clojure/PVNoLclhhB0/_NWqyE0cPAUJ&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="15742">CLJ-1083</key>
            <summary>Incorrect ArityException message for function names containing -&gt;</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="alexnixon">Alex Nixon</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Oct 2012 11:18:48 -0500</created>
                <updated>Fri, 7 Jun 2013 14:01:34 -0500</updated>
                                    <version>Release 1.2</version>
                <version>Release 1.3</version>
                <version>Release 1.4</version>
                <version>Release 1.5</version>
                                <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>2</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="30034" author="halgari" created="Mon, 26 Nov 2012 10:27:31 -0600"  >&lt;p&gt;Fix for this defect.&lt;/p&gt;</comment>
                    <comment id="30035" author="halgari" created="Mon, 26 Nov 2012 10:30:13 -0600"  >&lt;p&gt;The throwArity now attempts to locate and call clojure.main/demunge. If it finds the function it invokes it and uses the returned string in the error. Otherwise it just throws the actual class name. This results in the following behaviour:&lt;/p&gt;

&lt;p&gt;user=&amp;gt; (defn a-&amp;gt;b [])&lt;br/&gt;
#&apos;user/a-&amp;gt;b&lt;br/&gt;
user=&amp;gt; (a-&amp;gt;b 32)&lt;br/&gt;
ArityException Wrong number of args (1) passed to: user/a-&amp;gt;b  clojure.lang.AFn.throwArity (AFn.java:449)&lt;br/&gt;
user=&amp;gt; &lt;/p&gt;</comment>
                    <comment id="31146" author="stu" created="Fri, 24 May 2013 11:35:04 -0500"  >&lt;p&gt;Timothy: Why the empty catch block? I don&apos;t see anything in the try block whose failure we would want to ignore.&lt;/p&gt;</comment>
                    <comment id="31188" author="halgari" created="Thu, 30 May 2013 14:02:13 -0500"  >&lt;p&gt;The demunge function is created inside of a .clj file. So it is possible that we could hit this exception before demunge exists. The try simply says &quot;if we can get a better error message, use it. Otherwise, fall back to the old (half-broken) method of getting method names&quot;&lt;/p&gt;</comment>
                    <comment id="31220" author="jafingerhut" created="Fri, 7 Jun 2013 14:01:34 -0500"  >&lt;p&gt;Presumptuously changing approval from Incomplete back to its former value of Vetted after Timothy responded to what I believe is the reason it was marked Incomplete (Stu&apos;s question).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11710" name="better-throw-arity-messages.diff" size="1340" author="halgari" created="Mon, 26 Nov 2012 10:27:31 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-787] transient blows up when passed a vector created by subvec</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-787</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Subvectors created with subvec from a PersistentVector cannot be made transient:&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=&amp;gt; (&lt;span class=&quot;code-keyword&quot;&gt;transient&lt;/span&gt; (subvec [1 2 3 4] 2))
ClassCastException clojure.lang.APersistentVector$SubVector cannot be &lt;span class=&quot;code-keyword&quot;&gt;cast&lt;/span&gt; to clojure.lang.IEditableCollection  clojure.core/&lt;span class=&quot;code-keyword&quot;&gt;transient&lt;/span&gt; (core.clj:2864)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment></environment>
            <key id="14413">CLJ-787</key>
            <summary>transient blows up when passed a vector created by subvec</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="aredington">Alexander Redington</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 May 2011 07:23:56 -0500</created>
                <updated>Tue, 28 May 2013 11:50:25 -0500</updated>
                                    <version>Backlog</version>
                                <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="26477" author="stuart.sierra" created="Tue, 31 May 2011 09:28:01 -0500"  >&lt;p&gt;Confirmed. APersistentVector$SubVector does not implement IEditableCollection.&lt;/p&gt;

&lt;p&gt;The current implementation of TransientVector depends on implementation details of PersistentVector, so it is not a trivial fix. The simplest fix might be to implement IEditableCollection.asTransient in SubVector by creating a new PersistentVector, but I do not know the performance implications.&lt;/p&gt;</comment>
                    <comment id="31160" author="gfredericks" created="Sat, 25 May 2013 20:11:40 -0500"  >&lt;p&gt;We could get the same performance characteristics as SubVector by creating a TransientSubVector based on an underlying TransientVector, right?&lt;/p&gt;

&lt;p&gt;Preparing a patch to that effect.&lt;/p&gt;</comment>
                    <comment id="31161" author="gfredericks" created="Sat, 25 May 2013 22:58:13 -0500"  >&lt;p&gt;Text from the commit msg:&lt;/p&gt;

&lt;p&gt;Made two assumptions:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;It&apos;s okay for TransientSubVector to delegate the ensureEditable&lt;br/&gt;
    functionality to the underlying TransientVector (sometimes&lt;br/&gt;
    explicitely, sometimes implicitely) &amp;#8211; calling ensureEditable&lt;br/&gt;
    explicitely also requires that the field for the underlying vector&lt;br/&gt;
    be the concrete TransientVector type rather than the&lt;br/&gt;
    ITransientVector interface.&lt;/li&gt;
	&lt;li&gt;When an operation that would throw an exception on a&lt;br/&gt;
    PersistentVector happens from the wrong thread (or after&lt;br/&gt;
    persistent!), we throw that exception rather than the&lt;br/&gt;
    IllegalAccessError that transients throw when accessed&lt;br/&gt;
    inappropriately.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="12013" name="CLJ-787-p1.patch" size="5870" author="gfredericks" created="Sat, 25 May 2013 22:58:13 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1202] protocol fns with dashes may get compiled into property access when used higher order</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1202</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&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=&amp;gt; (defprotocol Foo (-foo [x]))
Foo
user=&amp;gt; (deftype Bar [] Foo (-foo [_] :baz))
user.Bar
user=&amp;gt; (map -foo [(Bar.)])
IllegalArgumentException No matching field found: foo &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; class user.Bar  
clojure.lang.Reflector.getInstanceField (Reflector.java:271)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I would have expected to see (:baz). The full stack is:&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;IllegalArgumentException No matching field found: foo &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; class user.Bar
	clojure.lang.Reflector.getInstanceField (Reflector.java:271)
	clojure.lang.Reflector.invokeNoArgInstanceMember (Reflector.java:300)
	user/eval79/fn--80/G--71--82 (NO_SOURCE_FILE:11)
	user/eval79/fn--80/G--70--85 (NO_SOURCE_FILE:11)
	clojure.core/map/fn--4207 (core.clj:2485)
	clojure.lang.LazySeq.sval (LazySeq.java:42)
	clojure.lang.LazySeq.seq (LazySeq.java:60)
	clojure.lang.RT.seq (RT.java:484)
	clojure.core/seq (core.clj:133)
	clojure.core/print-sequential (core_print.clj:46)
	clojure.core/fn--5406 (core_print.clj:143)
	clojure.lang.MultiFn.invoke (MultiFn.java:231)
nil&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I suspect this is somehow related to the property access changes to make Clojure/ClojureScript compatible. I was in fact prepping core.logic for a unified code base and was adopting the ClojureScript protocol naming convention when I encountered this issue.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-872&quot; title=&quot;Add support for property lookup&quot;&gt;&lt;del&gt;CLJ-872&lt;/del&gt;&lt;/a&gt; added dash property support to Clojure.&lt;/p&gt;</description>
                <environment></environment>
            <key id="16147">CLJ-1202</key>
            <summary>protocol fns with dashes may get compiled into property access when used higher order</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="dnolen">David Nolen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Apr 2013 20:48:27 -0500</created>
                <updated>Fri, 10 May 2013 15:19:29 -0500</updated>
                                    <version>Release 1.5</version>
                                <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="30970" author="amalloy" created="Thu, 18 Apr 2013 19:18:35 -0500"  >&lt;p&gt;Attached patch fixes the issue, and adds regression test for it.&lt;/p&gt;</comment>
                    <comment id="31080" author="cldwalker" created="Fri, 10 May 2013 15:19:29 -0500"  >&lt;p&gt;Verified patch works&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11962" name="CLJ-1202.patch" size="1759" author="amalloy" created="Thu, 18 Apr 2013 19:18:35 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-124] GC  Issue 120: Determine mechanism for controlling automatic shutdown of Agents, with a default policy and mechanism for changing that policy as needed</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-124</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&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;Reported by cemer...@snowtide.com, Jun 01, 2009

There has been intermittent chatter over the past months from a couple of
people on the group (e.g.
http:&lt;span class=&quot;code-comment&quot;&gt;//groups.google.com/group/clojure/browse_thread/thread/409054e3542adc1f)
&lt;/span&gt;and in #clojure about some clojure scripts hanging, either &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; a constant
time (usually reported as a minute or so with no CPU util) or seemingly
forever (or until someone kills the process).

I just hit a similar situation in our compilation process, which invokes
clojure.lang.Compile from ant.  The build process &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; particular
project had taken 15 second or so, but after adding a couple of pmap calls,
that build time jumped to ~1:15, with roughly zero CPU utilization over the
course of that last minute.

Adding a call to Agent.shutdown() in the &lt;span class=&quot;code-keyword&quot;&gt;finally&lt;/span&gt; block in
clojure.lang.Compile/main resolved the problem; a patch including &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;
change is attached.  I wouldn&apos;t suspect anyone would have any issues with
such a change.

-----
In general, it doesn&apos;t seem like everyone should keep tripping over &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;
problem in different directions.  It&apos;s a very difficult thing to debug &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;
you&apos;re not attuned to how clojure&apos;s concurrency primitives work under the
hood, and I would bet that newer users would be particularly affected.

After discussion in #clojure, rhickey suggested adding a
*auto-shutdown-agents* &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;, which:

- &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; when exiting one of the main entry points (clojure.main, or the
legacy script/repl entry points), Agent.shutdown() would be called,
allowing &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the clean exit of the application

- would be bound by &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; to &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;

- could be easily set to &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; anyone with an advanced use-&lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; that
requires agents to remain active after the main thread of the application
exits.

This would obviously not help anyone initializing clojure from a different
entry point, but &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; may represent the best compromise between
least-surprise and maximal functionality &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; advanced users.

------

In addition to the above, it perhaps might be worthwhile to change the
keepalive values used to create the Threadpools used by c.l.Actor&apos;s
Executors.  Currently, Actor uses a &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; thread pool executor, which
results in a 60s keepalive.  Lowering &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; to something much smaller (1s?
5s?) would additionally minimize the impact of Agent&apos;s threadpools on Java
applications that embed clojure directly (and would therefore not benefit
from *auto-shutdown-agents* as currently conceived, leading to puzzling
&apos;hanging&apos; behaviour).  I&apos;m not in a position to determine what impact &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;
would have on performance due to thread churn, but it would at least
minimize what would be perceived as undesirable behaviour by users that are
less familiar with the implementation details of Agent and code that
depends on it.

Comment 1  by cemer...@snowtide.com, Jun 01, 2009

Just FYI, I&apos;d be happy to provide patches &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; either of the suggestions mentioned
above...&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13521">CLJ-124</key>
            <summary>GC  Issue 120: Determine mechanism for controlling automatic shutdown of Agents, with a default policy and mechanism for changing that policy as needed</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="cemerick">Chas Emerick</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Jun 2009 23:24:00 -0500</created>
                <updated>Fri, 12 Apr 2013 09:52:24 -0500</updated>
                                                    <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>3</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="22862" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;Converted from &lt;a href=&quot;http://www.assembla.com/spaces/clojure/tickets/124&quot;&gt;http://www.assembla.com/spaces/clojure/tickets/124&lt;/a&gt;&lt;br/&gt;
Attachments:&lt;br/&gt;
compile-agent-shutdown.patch - &lt;a href=&quot;https://www.assembla.com/spaces/clojure/documents/a56S2ow4ur3O2PeJe5afGb/download/a56S2ow4ur3O2PeJe5afGb&quot;&gt;https://www.assembla.com/spaces/clojure/documents/a56S2ow4ur3O2PeJe5afGb/download/a56S2ow4ur3O2PeJe5afGb&lt;/a&gt;&lt;br/&gt;
124-compilation.diff - &lt;a href=&quot;https://www.assembla.com/spaces/clojure/documents/aqn0IGxZSr3RUGeJe5aVNr/download/aqn0IGxZSr3RUGeJe5aVNr&quot;&gt;https://www.assembla.com/spaces/clojure/documents/aqn0IGxZSr3RUGeJe5aVNr/download/aqn0IGxZSr3RUGeJe5aVNr&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="22863" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;oranenj said: [&lt;a href=&quot;file:a56S2ow4ur3O2PeJe5afGb&quot;&gt;file:a56S2ow4ur3O2PeJe5afGb&lt;/a&gt;]&lt;/p&gt;</comment>
                    <comment id="22864" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124)&lt;/p&gt;</comment>
                    <comment id="22865" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;cemerick said: (In [&lt;span class=&quot;error&quot;&gt;&amp;#91;r:fa3d24973fc415b35ae6ec8d84b61ace76bd4133&amp;#93;&lt;/span&gt;]) Add a call to Agent.shutdown() at the end of clojure.lang.Compile/main Refs #124&lt;/p&gt;

&lt;p&gt;Signed-off-by: Chouser &amp;lt;chouser@n01se.net&amp;gt;&lt;/p&gt;

&lt;p&gt;Branch: master&lt;/p&gt;</comment>
                    <comment id="22866" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;chouser@n01se.net said: I&apos;m closing this ticket to because the attached patch solves a specific problem.  I agree that the idea of an &lt;b&gt;auto-shutdown-agents&lt;/b&gt; var sounds like a positive compromise.  If Rich wants a ticket to track that issue, I think it&apos;d be best to open a new ticket (and perhaps mention this one there) rather than use this ticket to track further changes.&lt;/p&gt;</comment>
                    <comment id="22867" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;scgilardi said: With both Java 5 and Java 6 on Mac OS X 10.5 Leopard I&apos;m getting an error when compiling with this change present.&lt;/p&gt;

&lt;p&gt;Java 1.5.0_19&lt;br/&gt;
Java 1.6.0_13&lt;/p&gt;

&lt;p&gt;For example, when building clojure using &quot;ant&quot; from within my clone of the clojure repo:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;java&amp;#93;&lt;/span&gt; java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)&lt;br/&gt;
     &lt;span class=&quot;error&quot;&gt;&amp;#91;java&amp;#93;&lt;/span&gt;  at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)&lt;br/&gt;
     &lt;span class=&quot;error&quot;&gt;&amp;#91;java&amp;#93;&lt;/span&gt;  at java.security.AccessController.checkPermission(AccessController.java:427)&lt;br/&gt;
     &lt;span class=&quot;error&quot;&gt;&amp;#91;java&amp;#93;&lt;/span&gt;  at java.util.concurrent.ThreadPoolExecutor.shutdown(ThreadPoolExecutor.java:894)&lt;br/&gt;
     &lt;span class=&quot;error&quot;&gt;&amp;#91;java&amp;#93;&lt;/span&gt;  at clojure.lang.Agent.shutdown(Agent.java:34)&lt;br/&gt;
     &lt;span class=&quot;error&quot;&gt;&amp;#91;java&amp;#93;&lt;/span&gt;  at clojure.lang.Compile.main(Compile.java:71)&lt;/p&gt;

&lt;p&gt;I reproduced this on two Mac OS X 10.5 machines. I&apos;m not aware of having any enhanced security policies along these lines on my machines. The compile goes fine for me with Java 1.6.0_0 on an Ubuntu box.&lt;/p&gt;</comment>
                    <comment id="22868" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;chouser@n01se.net said: I had only tested it on my ubuntu box &amp;#8211; looks like that was openjdk 1.6.0_0.  I&apos;ll test again with sun-java5 and sun-java6.&lt;/p&gt;</comment>
                    <comment id="22869" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;chouser@n01se.net said: 1.6.0_13 worked fine for me on ubuntu, but 1.5.0_18 generated an the exception Steve pasted.  Any suggestions?  Should this patch be backed out until someone has a fix?&lt;/p&gt;</comment>
                    <comment id="22870" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;achimpassen said: [&lt;a href=&quot;file:aqn0IGxZSr3RUGeJe5aVNr&quot;&gt;file:aqn0IGxZSr3RUGeJe5aVNr&lt;/a&gt;]&lt;/p&gt;</comment>
                    <comment id="22871" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;chouser@n01se.net said: With Achim&apos;s patch, clojure compiles for me on ubuntu using java 1.5.0_18 from sun, and still works on 1.6.0_13 sun and 1.6.0_0 openjdk.  I don&apos;t know anything about ant or the security error, but this is looking good to me.&lt;/p&gt;</comment>
                    <comment id="22872" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;achimpassen said: It works for me on 1.6.0_13 and 1.5.0_19 (32 and 64 bit) on OS X 10.5.7.&lt;/p&gt;</comment>
                    <comment id="22873" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;chouser@n01se.net said: (In [&lt;span class=&quot;error&quot;&gt;&amp;#91;r:895b39dabc17b3fd766fdbac3b0757edb0d4b60d&amp;#93;&lt;/span&gt;]) Rev fa3d2497 causes compile to fail on some VMs &amp;#8211; back it out. Refs #124&lt;/p&gt;

&lt;p&gt;Branch: master&lt;/p&gt;</comment>
                    <comment id="22874" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;mikehinchey said: I got the same compile error on both 1.5.0_11 and 1.6.0_14 on Windows.  Achim&apos;s patch fixes both.&lt;/p&gt;

&lt;p&gt;See the note for &quot;permissions&quot; on &lt;a href=&quot;http://ant.apache.org/manual/CoreTasks/java.html&quot;&gt;http://ant.apache.org/manual/CoreTasks/java.html&lt;/a&gt; .  I assume ThreadPoolExecutor.shutdown is the problem, it would shutdown the main Ant thread, so Ant disallows that.  Forking avoids the permissions limitation.&lt;/p&gt;

&lt;p&gt;In addition, since the build error still resulted in &quot;BUILD SUCCESSFUL&quot;, I think failonerror=&quot;true&quot; should also be added to the java call so the build would totally fail for such an error.&lt;/p&gt;</comment>
                    <comment id="22875" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;chouser@n01se.net said: I don&apos;t know if the &amp;lt;java fork=true&amp;gt; patch is a good idea or not, or if there&apos;s a better way to solve the original problem.&lt;/p&gt;

&lt;p&gt;Chas, I&apos;m kicking back to you, but I guess if you don&apos;t want it you can reassign to &quot;nobody&quot;.&lt;/p&gt;</comment>
                    <comment id="22876" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;richhickey said: Updating tickets (#8, #42, #113, #2, #20, #94, #96, #104, #119, #124, #127, #149, #162)&lt;/p&gt;</comment>
                    <comment id="22877" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;shoover said: I&apos;d like to suggest an alternate approach. There are already well-defined and intuitive ways to block on agents and futures. Why not deprecate shutdown-agents and force users to call await and deref if they really want to block? In the pmap situation one would have to evaluate the pmap form.&lt;/p&gt;

&lt;p&gt;The System.exit problem goes away if you configure the threadpools to use daemon threads (call new ThreadPoolExecutor and pass a thread factory that creates threads and sets daemon to true). That way the user has an explicit means of blocking and System.exit won&apos;t hang.&lt;/p&gt;</comment>
                    <comment id="22878" author="importer" created="Tue, 24 Aug 2010 00:45:00 -0500"  >&lt;p&gt;alexdmiller said: I blogged about these issues at:&lt;br/&gt;
&lt;a href=&quot;http://tech.puredanger.com/2010/06/08/clojure-agent-thread-pools/&quot;&gt;http://tech.puredanger.com/2010/06/08/clojure-agent-thread-pools/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think that:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;agent thread pool threads should be named (see ticket &lt;a href=&quot;https://www.assembla.com/spaces/clojure/tickets/378-set-thread-names-on-agent-thread-pools&quot;&gt;#378&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;agent thread pools must be daemon threads by default&lt;/li&gt;
	&lt;li&gt;having ways to specify an customized executor pool for an agent send/send-off is essential to customize threading behavior&lt;/li&gt;
	&lt;li&gt;(shutdown-agents) should be either deprecated or made less dangerous&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="26565" author="ataggart" created="Mon, 11 Jul 2011 21:33:24 -0500"  >&lt;p&gt;Rich, what is the intention behind using non-daemon threads in the agent pools?&lt;/p&gt;

&lt;p&gt;If it is because daemon threads could terminate before their work is complete, would it be acceptable to &lt;a href=&quot;http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)&quot;&gt;add a shutdown hook&lt;/a&gt; to ensure against such premature termination?  Such a shutdown hook could call &lt;tt&gt;Agent.shutdown()&lt;/tt&gt;, then &lt;a href=&quot;http://download.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ExecutorService.html#awaitTermination(long, java.util.concurrent.TimeUnit)&quot;&gt;&lt;tt&gt;awaitTermination()&lt;/tt&gt;&lt;/a&gt; on the pools.&lt;/p&gt;</comment>
                    <comment id="30069" author="redinger" created="Tue, 27 Nov 2012 15:47:20 -0600"  >&lt;p&gt;Moving this ticket out of approval &quot;OK&quot; status, and dropping the priority. These were Assembla import defaults.&lt;/p&gt;

&lt;p&gt;Also, Chas gets to be the Reporter now.&lt;/p&gt;</comment>
                    <comment id="30072" author="cemerick" created="Tue, 27 Nov 2012 17:56:24 -0600"  >&lt;p&gt;Heh, blast from the past.&lt;/p&gt;

&lt;p&gt;The comment import appears to have set their timestamps to the date of the import, so the conversation is pretty hard to follow, and obviously doesn&apos;t benefit from the intervening years of experience.  In addition, there have been plenty of changes to agents, including some &lt;a href=&quot;https://github.com/clojure/clojure/commit/f5f4faf&quot;&gt;recent enhancements&lt;/a&gt; that address some of the pain points that Alex Miller mentioned above.&lt;/p&gt;

&lt;p&gt;I propose closing this as &apos;invalid&apos; or whatever, and opening one or more new issues to track whatever issues still persist (presumably based on fresh ML discussion, etc).&lt;/p&gt;</comment>
                    <comment id="30073" author="jafingerhut" created="Tue, 27 Nov 2012 18:11:09 -0600"  >&lt;p&gt;Rereading the original description of this ticket, without reading all of the comments that follow, that description is still right on target for the behavior of latest Clojure master today.&lt;/p&gt;

&lt;p&gt;People send messages to the Clojure Google group every couple of months hitting this issue, and one even filed &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-959&quot; title=&quot;after call to clojure.java.shell/sh, jvm won&amp;#39;t exit&quot;&gt;CLJ-959&lt;/a&gt; because of hitting it.  I have updated the examples on ClojureDocs.org for future, and also for pmap and clojure.java.shell/sh which use future in their implementations, to warn people about this and explain that they should call (shutdown-agents), but making it unnecessary to call shutdown-agents would be even better, at least as the default behavior.  It sounds fine to me to provide a way for experts on thread behavior to change that default behavior if they need to.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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_10003" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                <customfieldname>Waiting On</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>richhickey</customfieldvalue>
                </customfieldvalues>
            </customfield>
                            </customfields>
    </item>

<item>
            <title>[CLJ-1058] StackOverflowError on exception in reducef for PersistentHashMap fold</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1058</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;If reducef throws an exception, the PHM fold code can descend into an infinite loop, causing a stack overflow which masks the problem. This situation is commented &quot;aargh&quot; in PersistentHashMap.java line 444 (as of 412a51d).&lt;/p&gt;

&lt;p&gt;To reproduce:&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&amp;gt; (require &apos;[clojure.core.reducers :as r])
nil
user&amp;gt; (r/fold (fn ([]) ([ret k v] (+ 3 &lt;span class=&quot;code-quote&quot;&gt;&quot;foo&quot;&lt;/span&gt;) ret)) (into {} (map (juxt identity identity) (range 10000))))
;; boom&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This results in a stack like: &lt;a href=&quot;https://raw.github.com/gist/3bab917287a7fd635a84/f38bfe3e270556e467f3fc02062af7ea10781390/gistfile1.txt&quot;&gt;https://raw.github.com/gist/3bab917287a7fd635a84/f38bfe3e270556e467f3fc02062af7ea10781390/gistfile1.txt&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Clojure 1.5.0-alpha4, Sun Java 1.6.0_35, with [org.codehaus.jsr166-mirror/jsr166y &amp;quot;1.7.0&amp;quot;]</environment>
            <key id="15668">CLJ-1058</key>
            <summary>StackOverflowError on exception in reducef for PersistentHashMap fold</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="tomoj">Tom Jack</reporter>
                        <labels>
                    </labels>
                <created>Sun, 2 Sep 2012 17:20:02 -0500</created>
                <updated>Fri, 12 Apr 2013 09:42:02 -0500</updated>
                                    <version>Release 1.5</version>
                                <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="30124" author="halgari" created="Fri, 30 Nov 2012 15:40:59 -0600"  >&lt;p&gt;Verified as a bug. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-420] Some compiler exceptions erroneously using REPL line numbers.</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-420</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Certain kinds of errors in loaded source files are coming back tagged with the correct source file, but what seems to be the REPL line number.  &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://groups.google.com/group/clojure/browse_frm/thread/beb36e7228eabd69/a7ef16dcc45834bc?hl=en#a7ef16dcc45834bc&quot;&gt;http://groups.google.com/group/clojure/browse_frm/thread/beb36e7228eabd69/a7ef16dcc45834bc?hl=en#a7ef16dcc45834bc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;jawolfe@&lt;span class=&quot;error&quot;&gt;&amp;#91;~/Projects/testproj&amp;#93;&lt;/span&gt;: cat &amp;gt; src/test.clj&lt;/p&gt;

&lt;p&gt;bla&lt;br/&gt;
jawolfe@&lt;span class=&quot;error&quot;&gt;&amp;#91;~/Projects/testproj&amp;#93;&lt;/span&gt;: cat &amp;gt; src/test2.clj&lt;/p&gt;

&lt;p&gt;(bla)&lt;br/&gt;
jawolfe@&lt;span class=&quot;error&quot;&gt;&amp;#91;~/Projects/testproj&amp;#93;&lt;/span&gt;: lein repl&lt;br/&gt;
user=&amp;gt; (require &apos;test)&lt;br/&gt;
java.lang.Exception: Unable to resolve symbol: bla in this context&lt;br/&gt;
(test.clj:1)&lt;br/&gt;
user=&amp;gt; (require &apos;test)a&lt;br/&gt;
java.lang.Exception: Unable to resolve symbol: bla in this context&lt;br/&gt;
(test.clj:2)&lt;br/&gt;
user=&amp;gt; (require &apos;test)&lt;br/&gt;
java.lang.Exception: Unable to resolve symbol: bla in this context&lt;br/&gt;
(test.clj:3)&lt;br/&gt;
user=&amp;gt; (require &apos;test2)&lt;br/&gt;
java.lang.Exception: Unable to resolve symbol: bla in this context&lt;br/&gt;
(test2.clj:2)&lt;br/&gt;
user=&amp;gt; (require &apos;test2)&lt;br/&gt;
java.lang.Exception: Unable to resolve symbol: bla in this context&lt;br/&gt;
(test2.clj:2)&lt;br/&gt;
user=&amp;gt; (require &apos;test2)&lt;br/&gt;
java.lang.Exception: Unable to resolve symbol: bla in this context&lt;br/&gt;
(test2.clj:2)&lt;br/&gt;
user=&amp;gt; (require &apos;test)&lt;br/&gt;
java.lang.Exception: Unable to resolve symbol: bla in this context&lt;br/&gt;
(test.clj:7)&lt;br/&gt;
user=&amp;gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="13817">CLJ-420</key>
            <summary>Some compiler exceptions erroneously using REPL line numbers.</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="aredington">Alexander Redington</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 Aug 2010 04:46:00 -0500</created>
                <updated>Fri, 12 Apr 2013 09:42:02 -0500</updated>
                                    <version>Approved Backlog</version>
                                <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="24177" author="importer" created="Tue, 28 Sep 2010 21:59:00 -0500"  >&lt;p&gt;Converted from &lt;a href=&quot;http://www.assembla.com/spaces/clojure/tickets/420&quot;&gt;http://www.assembla.com/spaces/clojure/tickets/420&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="24178" author="importer" created="Tue, 28 Sep 2010 21:59:00 -0500"  >&lt;p&gt;stu said: Updating tickets (#427, #426, #421, #420, #397)&lt;/p&gt;</comment>
                    <comment id="24179" author="importer" created="Tue, 28 Sep 2010 21:59:00 -0500"  >&lt;p&gt;stu said: Updating tickets (#429, #437, #397, #420)&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-1105] defrecord classes implement IPersistentCollection but not .empty, clojure.walk assumes collections support empty</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1105</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Using clojure.walk functions fails surprisingly for data containing records defined with defrecord:&lt;/p&gt;

&lt;p&gt;user=&amp;gt; (defrecord Foo &lt;span class=&quot;error&quot;&gt;&amp;#91;x&amp;#93;&lt;/span&gt;)&lt;br/&gt;
user.Foo&lt;br/&gt;
user=&amp;gt; (def f (Foo. :x))&lt;br/&gt;
#&apos;user/f&lt;br/&gt;
user=&amp;gt; (use &apos;clojure.walk)&lt;br/&gt;
nil&lt;br/&gt;
user=&amp;gt; (postwalk identity {:foo f})&lt;br/&gt;
UnsupportedOperationException Can&apos;t create empty: user.Foo  user.Foo (NO_SOURCE_FILE:1)&lt;/p&gt;

&lt;p&gt;This seems to be because clojure.walk/walk guards a call to (empty form) with a (coll? form) check. The check succeeds because records implement IPersistentCollection, but (empty form) throws an exception. This looks to me like a bug in clojure.walk (it should check records separately and either treat them as atomic or implement a way of walking through them) but perhaps it is a sign of some unclarity in the contract of collections.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15817">CLJ-1105</key>
            <summary>defrecord classes implement IPersistentCollection but not .empty, clojure.walk assumes collections support empty</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="jks">Jouni K. Sepp&#228;nen</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Nov 2012 08:20:52 -0600</created>
                <updated>Fri, 12 Apr 2013 09:42:00 -0500</updated>
                                    <version>Release 1.4</version>
                                <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="29912" author="bronsa" created="Thu, 8 Nov 2012 14:35:42 -0600"  >&lt;p&gt;maybe clojure should follow clojurescript&apos;s footsteps and move empty out of IPersistentCollection and create an&lt;br/&gt;
interface IEmptyableCollection extends IPersistentCollection {
  IEmptyableCollection empty();
}&lt;/p&gt;</comment>
                    <comment id="30029" author="stu" created="Sun, 25 Nov 2012 18:39:22 -0600"  >&lt;p&gt;Can whoever claims this please consider walk&apos;s behavior in the face of all different collection types? I think it also fails with Java collections. &lt;/p&gt;

&lt;p&gt;Also, the collection partitioning code in clojure.data may be of use.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-701] Compiler loses &apos;loop&apos;s return type in some cases</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-701</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&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;(set! *warn-on-reflection* &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
(fn [] (loop [b 0] (recur (loop [a 1] a))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Generates the following warnings:&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;recur arg for primitive local: b is not matching primitive, had: Object, needed: long
Auto-boxing loop arg: b
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is interesting for several reasons.  For one, if the arg to &lt;tt&gt;recur&lt;/tt&gt; is a &lt;tt&gt;let&lt;/tt&gt; form, there is no warning:&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;(fn [] (loop [b 0] (recur (let [a 1] a))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Also, the compiler appears to understand the return type of &lt;tt&gt;loop&lt;/tt&gt; forms just fine:&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;(use &apos;[clojure.contrib.repl-utils :only [expression-info]])
(expression-info &apos;(loop [a 1] a))
;=&amp;gt; {:class &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt;, :primitive? &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem can of course be worked around using an explicit cast on the &lt;tt&gt;loop&lt;/tt&gt; form:&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;(fn [] (loop [b 0] (recur (&lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt; (loop [a 1] a)))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Reported by leafw in IRC: &lt;a href=&quot;http://clojure-log.n01se.net/date/2011-01-03.html#10:31&quot;&gt;http://clojure-log.n01se.net/date/2011-01-03.html#10:31&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Clojure commit 9052ca1854b7b6202dba21fe2a45183a4534c501, version 1.3.0-master-SNAPSHOT</environment>
            <key id="14310">CLJ-701</key>
            <summary>Compiler loses &apos;loop&apos;s return type in some cases</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="chouser@n01se.net">Chouser</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Jan 2011 10:56:07 -0600</created>
                <updated>Fri, 12 Apr 2013 09:42:00 -0500</updated>
                                    <version>Approved Backlog</version>
                                <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="26081" author="a_strange_guy" created="Mon, 3 Jan 2011 16:36:27 -0600"  >&lt;p&gt;The problem is that a &apos;loop form gets converted into an anonymous fn that gets called immediately, when the loop is in a expression context (eg. its return value is needed, but not as the return value of a method/fn).&lt;/p&gt;

&lt;p&gt;so&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;(fn [] (loop [b 0] (recur (loop [a 1] a))))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;gets converted into&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;(fn [] (loop [b 0] (recur ((fn [] (loop [a 1] a))))))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;see the code in the compiler:&lt;br/&gt;
&lt;a href=&quot;http://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L5572&quot;&gt;http://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L5572&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;this conversion already bites you if you have mutable fields in a deftype and want to &apos;set! them in a loop&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-274&quot;&gt;http://dev.clojure.org/jira/browse/CLJ-274&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="30009" author="cgrand" created="Fri, 23 Nov 2012 02:28:14 -0600"  >&lt;p&gt;loops in expression context are lifted into fns because else Hotspot doesn&apos;t optimize them.&lt;br/&gt;
This causes several problems:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;type inference doesn&apos;t propagate outside of the loop&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;the return value is never a primitive&lt;/li&gt;
	&lt;li&gt;mutable fields are inaccessible&lt;/li&gt;
	&lt;li&gt;surprise allocation of one closure objects each time the loop is entered.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Adressing all those problems isn&apos;t easy. &lt;br/&gt;
One can compute the type of the loop and emit a type hint but it works only with reference types. To make it works with primitive, primitie fns aren&apos;t enough since they return only long/double: you have to add explicit casts.&lt;br/&gt;
So solving the first two points can be done in a rather lccal way.&lt;br/&gt;
The two other points require more impacting changes, the goal would be to emit a method rather than a fn. So it means at the very least changing ObjExpr and adding a new subclassof  ObjMethod.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; beware of &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1111&quot; title=&quot;Loops returning primtives are boxed even in return position&quot;&gt;&lt;del&gt;CLJ-1111&lt;/del&gt;&lt;/a&gt; when testing. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-1154] Compile.java closes out preventing java from reporting exceptions</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1154</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;I was trying to compile a project that has some native dependencies.  I am using clojure-maven-plugin version 1.3.13 with Maven 2.0.  I forgot to set java.library.path properly so that the native library could be found, and only got an error of&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;[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Clojure failed.
[INFO] ------------------------------------------------------------------------
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I traced this down to Compile.java, where it is flushing and closing &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;out&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; in the finally block.  The JVM uses out to write out a stack trace for any uncaught exceptions.  When out is closed it is unable to write out the stack trace for the UnsatisfiedLinkError that was being thrown.  This made it very difficult to debug what was happening.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15983">CLJ-1154</key>
            <summary>Compile.java closes out preventing java from reporting exceptions</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="revans2">Robert (Bobby) Evans</reporter>
                        <labels>
                    </labels>
                <created>Thu, 31 Jan 2013 13:04:08 -0600</created>
                <updated>Fri, 12 Apr 2013 09:31:03 -0500</updated>
                                    <version>Release 1.4</version>
                                <fixVersion>Release 1.5</fixVersion>
                <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="30677" author="stu" created="Fri, 1 Mar 2013 10:45:51 -0600"  >&lt;p&gt;I have encountered this problem as well.  Did not verify the explanation, but sounds reasonable.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-823] Piping seque into seque can deadlock</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-823</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;I&apos;m not sure if this is a supported scenario, but the following deadlocks in Clojure 1.3:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;(let [xs (seque (range 150000))&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;ys (seque (filter odd? xs))]&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;(apply + ys))&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;As I understand it, the problem is that ys&apos; fill takes place on an agent thread, so when it calls xs&apos; drain, the &lt;tt&gt;(send-off agt fill)&lt;/tt&gt; does not immediately trigger xs&apos; fill, but is instead put on the nested list to be performed when ys&apos; agent returns. Unfortunately, ys&apos; fill will eventually block trying to take from xs, and so it never returns and the pending send-offs are never sent. Wrapping the send-off in drain to:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;(future (send-off agt fill))&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;is a simple (probably not optimal) way to fix the deadlock.&lt;/p&gt;</description>
                <environment>Windows 7; JVM 1.6; Clojure 1.3 beta 1</environment>
            <key id="14557">CLJ-823</key>
            <summary>Piping seque into seque can deadlock</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="glchapman">Greg Chapman</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Aug 2011 13:28:22 -0500</created>
                <updated>Fri, 12 Apr 2013 09:23:49 -0500</updated>
                                    <version>Release 1.3</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="30401" author="pmonks" created="Mon, 7 Jan 2013 15:43:29 -0600"  >&lt;p&gt;Reproduced on 1.4.0 and 1.5.0-RC1 as well, albeit with this example:&lt;/p&gt;

&lt;p&gt;(seque 3 (seque 3 (range 10)))&lt;/p&gt;</comment>
                    <comment id="30852" author="stu" created="Sat, 30 Mar 2013 09:16:33 -0500"  >&lt;p&gt;release-pending-sends?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-1157] Classes generated by gen-class aren&apos;t loadable from remote codebase for mis-implementation of static-initializer</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1157</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;When a client program uses a remote service which uses RMI, and the service returns a object which created with gen-class with clojure as the return value, the return value is not loadable at client side.&lt;/p&gt;

&lt;p&gt;At client side, a following exeption will be thrown.&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;Exception in thread &lt;span class=&quot;code-quote&quot;&gt;&quot;main&quot;&lt;/span&gt; java.lang.ExceptionInInitializerError
        at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
        at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1723)
        at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:69)
        at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:247)
        at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:245)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:244)
        at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:600)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
        at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:324)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
        at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
        at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
        at $Proxy0.getResult(Unknown Source)
        at client.SampleClient$_main.doInvoke(SampleClient.clj:12)
        at clojure.lang.RestFn.invoke(RestFn.java:397)
        at clojure.lang.AFn.applyToHelper(AFn.java:159)
        at clojure.lang.RestFn.applyTo(RestFn.java:132)
        at client.SampleClient.main(Unknown Source)
 Caused by: java.io.FileNotFoundException: Could not locate remoteserver/SampleInterfaceImpl__init.class or remoteserver/SampleInterfaceImpl.clj on classpath: 
        at clojure.lang.RT.load(RT.java:434)
        at clojure.lang.RT.load(RT.java:402)
        at clojure.core$load$fn__5039.invoke(core.clj:5520)
        at clojure.core$load.doInvoke(core.clj:5519)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.lang.Var.invoke(Var.java:415)
        at remoteserver.SampleInterfaceImpl.&amp;lt;clinit&amp;gt;(Unknown Source)
        ... 23 more&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h2&gt;&lt;a name=&quot;HOWTOREPRODUCTTHISISSUE&quot;&gt;&lt;/a&gt;HOW TO REPRODUCT THIS ISSUE&lt;/h2&gt;

&lt;p&gt;If you want to see this issue at your computer, clone my example project from my github.&lt;/p&gt;

&lt;p&gt;git clone git://github.com/tyano/clojure_genclass_fix.git&lt;/p&gt;

&lt;p&gt;and build them (You must have installed Leiningen 2):&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-none&quot;&gt;cd clojure_genclass_fix
sh build.sh&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;start rmiregistry:&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-none&quot;&gt;rmiregistry &amp;amp;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;start remoteserver:&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-none&quot;&gt;cd remoteserver
sh start.sh&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You will see a message &quot;Server ready. &quot; or &quot;Server ready. (rebind)&quot;.&lt;/p&gt;

&lt;p&gt;At last, start client program:&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-none&quot;&gt;cd ../client
sh start.sh&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Without my patch, you will see a same Exception described above. But with clojure with my patch, you will see a right response message: &quot;response = this is sample.&quot;&lt;/p&gt;


&lt;h2&gt;&lt;a name=&quot;THEREASON&quot;&gt;&lt;/a&gt;THE REASON        &lt;/h2&gt;

&lt;p&gt;The reason of this problem is in bytecodes generated by gen-class. A gen-classed class (in this case, SampleInterfaceImpl.class) uses a static-initializer for loading SampleInterfaceImpl__init.class (which load other classes which implements functions in the class). The static-initializer is like bellow: (the following code is decompiled with JD - &lt;a href=&quot;http://java.decompiler.free.fr/?q=jdgui&quot;&gt;http://java.decompiler.free.fr/?q=jdgui&lt;/a&gt; )&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;&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt;
  {
    RT.&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&quot;clojure.core&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;load&quot;&lt;/span&gt;).invoke(&lt;span class=&quot;code-quote&quot;&gt;&quot;/remoteserver/SampleInterfaceImpl&quot;&lt;/span&gt;);
  }&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Very simple code. it seems non-problematic. But RT.load changes the classloader for loading __init.class in the processing! RT.load in default uses a context-classloader for loading classes. But all classes depending on a gen-classed class must be loaded a same classloader with a main gen-classed class. In this case, RT.load must use a remote URLClassLoader which load a main class.&lt;/p&gt;

&lt;p&gt;So, gen-class must be create bytecodes that is same with the following java code.&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;&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt;
  {
    Var.pushThreadBindings(RT.map(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;[] { &lt;span class=&quot;code-object&quot;&gt;Compiler&lt;/span&gt;.LOADER, SampleInterfaceImpl.class.getClassLoader() }));
    &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
        RT.&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&quot;clojure.core&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;load&quot;&lt;/span&gt;).invoke(&lt;span class=&quot;code-quote&quot;&gt;&quot;/remoteserver/SampleInterfaceImpl&quot;&lt;/span&gt;);
    }
    &lt;span class=&quot;code-keyword&quot;&gt;finally&lt;/span&gt; 
    {
        Var.popThreadBindings();
    }
  }&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With this code, RT.load will uses a same classloader which load SampleInterfaceImpl.class.&lt;br/&gt;
My patch for gen-class will create bytecodes equal to the above example.&lt;/p&gt;

&lt;p&gt;You can use an attached patch &apos;20130204_fix_classloader.diff&apos;, or pull &apos;fix_classloader&apos; branch from my github repositry ( git@github.com:tyano/clojure.git ).&lt;/p&gt;</description>
                <environment>Tested on Mac OS X 10.8 and Oracle JVM 1.7.0 update 13.</environment>
            <key id="15988">CLJ-1157</key>
            <summary>Classes generated by gen-class aren&apos;t loadable from remote codebase for mis-implementation of static-initializer</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="tyano">Tsutomu Yano</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Feb 2013 01:06:21 -0600</created>
                <updated>Fri, 12 Apr 2013 09:19:05 -0500</updated>
                                    <version>Release 1.4</version>
                <version>Release 1.5</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="30675" author="stu" created="Fri, 1 Mar 2013 10:20:27 -0600"  >&lt;p&gt;This sounds reasonable, but anything touching classloaders must be considered very carefully.&lt;/p&gt;</comment>
                    <comment id="30679" author="stu" created="Fri, 1 Mar 2013 12:12:09 -0600"  >&lt;p&gt;It seems overly complex to have the patch do so much code generation.  Why not implement a method that does this job, and have the generated code call that?&lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="11832" name="20130204_fix_classloader.diff" size="4563" author="tyano" created="Mon, 4 Feb 2013 01:06:21 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-348] reify allows use of qualified name as method parameter</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-348</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;This should complain about using a fully-qualified name as a parameter:&lt;/p&gt;

&lt;p&gt;(defmacro lookup []&lt;br/&gt;
  `(reify clojure.lang.ILookup&lt;br/&gt;
          (valAt &lt;span class=&quot;error&quot;&gt;&amp;#91;_ key&amp;#93;&lt;/span&gt;)))&lt;/p&gt;

&lt;p&gt;Instead it simply ignores that parameter in the method body in favour of clojure.core/key.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13745">CLJ-348</key>
            <summary>reify allows use of qualified name as method parameter</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="importer">Assembla Importer</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 May 2010 14:30:00 -0500</created>
                <updated>Fri, 1 Mar 2013 12:33:02 -0600</updated>
                                                    <fixVersion>Approved Backlog</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="23886" author="importer" created="Tue, 24 Aug 2010 08:03:00 -0500"  >&lt;p&gt;Converted from &lt;a href=&quot;http://www.assembla.com/spaces/clojure/tickets/348&quot;&gt;http://www.assembla.com/spaces/clojure/tickets/348&lt;/a&gt;&lt;br/&gt;
Attachments:&lt;br/&gt;
0001-Add-a-test-for-348-reify-shouldn-t-accept-qualified-.patch - &lt;a href=&quot;https://www.assembla.com/spaces/clojure/documents/d2xUJIxTyr36fseJe5cbLA/download/d2xUJIxTyr36fseJe5cbLA&quot;&gt;https://www.assembla.com/spaces/clojure/documents/d2xUJIxTyr36fseJe5cbLA/download/d2xUJIxTyr36fseJe5cbLA&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="23887" author="importer" created="Tue, 24 Aug 2010 08:03:00 -0500"  >&lt;p&gt;technomancy said: [&lt;a href=&quot;file:d2xUJIxTyr36fseJe5cbLA&quot;&gt;file:d2xUJIxTyr36fseJe5cbLA&lt;/a&gt;]: A test to expose the unwanted behaviour&lt;/p&gt;</comment>
                    <comment id="23888" author="importer" created="Tue, 24 Aug 2010 08:03:00 -0500"  >&lt;p&gt;richhickey said: I&apos;m not sure the bug is what you say it is, or the resolution should be what you suggest. The true problem is the resolution of key when qualified. Another possibility is to ignore the qualifier there.&lt;/p&gt;</comment>
                    <comment id="23889" author="importer" created="Tue, 24 Aug 2010 08:03:00 -0500"  >&lt;p&gt;technomancy said: Interesting. So it&apos;s not appropriate to require auto-gensym here? Why are the rules different for reify methods vs proxy methods?&lt;/p&gt;

&lt;p&gt;&amp;gt; (defmacro lookup []&lt;br/&gt;
  `(proxy &lt;span class=&quot;error&quot;&gt;&amp;#91;clojure.lang.ILookup&amp;#93;&lt;/span&gt; []&lt;br/&gt;
          (valAt &lt;span class=&quot;error&quot;&gt;&amp;#91;key&amp;#93;&lt;/span&gt; key)))&lt;br/&gt;
&amp;gt; (lookup)&lt;/p&gt;

&lt;p&gt;Can&apos;t use qualified name as parameter: clojure.core/key&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;Thrown class java.lang.Exception&amp;#93;&lt;/span&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-1073] Make print-sequential interruptible</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1073</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;This allows print-sequential to be interrupted by Thread.interrupt(), rather than requiring clients to resort to Thread.stop(). This is especially helpful when printing very large sequences.&lt;/p&gt;

&lt;p&gt;See also clojure-dev discussion at &lt;a href=&quot;https://groups.google.com/d/topic/clojure-dev/vs0RNUQXiYE/discussion&quot;&gt;https://groups.google.com/d/topic/clojure-dev/vs0RNUQXiYE/discussion&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="15713">CLJ-1073</key>
            <summary>Make print-sequential interruptible</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="trptcolin">Colin Jones</reporter>
                        <labels>
                        <label>patch</label>
                    </labels>
                <created>Fri, 21 Sep 2012 16:10:46 -0500</created>
                <updated>Fri, 1 Mar 2013 10:18:01 -0600</updated>
                                    <version>Release 1.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="29522" author="jafingerhut" created="Fri, 21 Sep 2012 19:04:21 -0500"  >&lt;p&gt;In a quickly hacked up performance test on Mac OS X 10.6.8 + Oracle/Apple JDK 1.6.0_35 which I can attach, I saw about a 9% to 10% slowdown for Colin&apos;s patch in printing large vectors.&lt;/p&gt;

&lt;p&gt;I have a modified patch that only calls Thread/interrupted after every 20 items are printed, and with that version the slowdown versus the original code was about 3% to 4%.&lt;/p&gt;

&lt;p&gt;Colin, would there be any down side to checking Thread/interrupted less often for your purposes?&lt;/p&gt;

&lt;p&gt;To run performance test, edit attachment compile.sh to point at your clojure.jar, put file perftest-print.clj in the same directory, and run ./compile.sh    It should work on Mac or Linux.&lt;/p&gt;</comment>
                    <comment id="29523" author="jafingerhut" created="Sat, 22 Sep 2012 10:47:08 -0500"  >&lt;p&gt;clj-1073-allow-thread-interrupt-in-print-sequential-patch.txt dated Sep 22 2012 is similar to Colin&apos;s patch 0001-Allow-thread-interruption-in-print-sequential.patch dated Sep 21 2012, except it only checks interrupted status every 20 (or maybe 21?) times through the loop in print-sequential.  It is the one that is 3-4% slower than the current latest master Clojure code in my performance test mentioned above, versus Colin&apos;s patch which is about 9-10% slower on that test.&lt;/p&gt;</comment>
                    <comment id="29700" author="stu" created="Fri, 19 Oct 2012 15:31:32 -0500"  >&lt;p&gt;Is this primarily intended for dev-time use? I wouldn&apos;t want to lose performance for this if there is any way to implement it as a dev-time feature.&lt;/p&gt;</comment>
                    <comment id="29701" author="trptcolin" created="Fri, 19 Oct 2012 16:27:09 -0500"  >&lt;p&gt;Andy: The only caveat I can think of with checking Thread/interrupted less often is in the case of deeply nested collections.&lt;/p&gt;

&lt;p&gt;Stu: Dev-time use was the original reason for opening this, yes. But I can imagine it being needed for anytime a thread can be interrupted, whether that&apos;s by ctrl-c or other means.&lt;/p&gt;

&lt;p&gt;My original thinking, performance-wise, was that once we&apos;re already doing IO, we&apos;re probably not too concerned with CPU-bound checks like this, so I didn&apos;t bother with it. I guess with an SSD that&apos;s not as likely to be true.&lt;/p&gt;

&lt;p&gt;Locally (w/ my SSD), I&apos;m seeing that Andy&apos;s benchmark of printing a million numbers is about a second slower than the baseline with my original patch (12.08s -&amp;gt; 13.10s), and about the same with Andy&apos;s patch (12.08s -&amp;gt; 11.75s). Decreasing to a thousand numbers doesn&apos;t really show any difference (every version completes in ~1.3s). Bumping to 2 million adds 2 seconds above the baseline with my patch, and Andy&apos;s is again just a bit faster than the baseline (somehow). Bumping to 5 million runs me out of heap space &lt;img class=&quot;emoticon&quot; src=&quot;http://dev.clojure.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="29913" author="jafingerhut" created="Thu, 8 Nov 2012 16:16:24 -0600"  >&lt;p&gt;clj-1073-add-print-interruptibly-patch-v1.txt dated Nov 8 2012 is the same idea as Colin&apos;s patch 0001-Allow-thread-interruption-in-print-sequential.patch dated Sep 21 2012, except it only checks (Thread/interrupted) if a new var &lt;b&gt;print-interruptibly&lt;/b&gt; is true.  Its default value is false.&lt;/p&gt;

&lt;p&gt;Performance results of the perftest-print.clj program, as driven by the test.sh script, for Clojure 1.5-beta1 and with two different patches.  All run times are elapsed, in seconds, and sorted in increasing order for easier comparison.&lt;/p&gt;

&lt;p&gt;Executive summary: Performance results when &lt;b&gt;print-interruptibly&lt;/b&gt; is left at default false value are pretty much same as today.  With &lt;b&gt;print-interruptibly&lt;/b&gt; bound to true, performance results are slower, as expected, and about the same as with Colin&apos;s patch.&lt;/p&gt;

&lt;p&gt;Original 1.5-beta1 unchanged:&lt;br/&gt;
13.75 13.80 13.83 13.87 13.93&lt;/p&gt;

&lt;p&gt;With this new &lt;b&gt;print-interruptibly&lt;/b&gt; patch, with &lt;b&gt;print-interruptibly&lt;/b&gt;&lt;br/&gt;
at default false value:&lt;br/&gt;
13.86 13.91 14.01 14.08 14.14&lt;/p&gt;

&lt;p&gt;With this new &lt;b&gt;print-interruptibly&lt;/b&gt; patch, with &lt;b&gt;print-interruptibly&lt;/b&gt;&lt;br/&gt;
bound to true while printing (so a slightly modified version of&lt;br/&gt;
perftest-print.clj that does (binding &lt;span class=&quot;error&quot;&gt;&amp;#91;*print-interruptibly* true&amp;#93;&lt;/span&gt;&lt;br/&gt;
...) around the heart of the code):&lt;br/&gt;
15.29 15.44 15.45 15.62 15.63&lt;/p&gt;

&lt;p&gt;With patch 0001-Allow-thread-interruption-in-print-sequential.patch&lt;br/&gt;
applied:&lt;br/&gt;
15.38 15.46 15.48 15.49 15.50&lt;/p&gt;</comment>
                    <comment id="29933" author="trptcolin" created="Mon, 12 Nov 2012 13:37:10 -0600"  >&lt;p&gt;Andy&apos;s latest patch looks good &amp;amp; makes it easy for the REPL and other interruptible scenarios to opt into the &quot;safe&quot; behavior. I would personally have preferred to have the &quot;safe&quot; behavior on by default, but can understand the performance concerns, and this gets me what I really wanted.&lt;/p&gt;</comment>
                    <comment id="30122" author="halgari" created="Fri, 30 Nov 2012 15:09:07 -0600"  >&lt;p&gt;Vetting as it sounds like the performance issues are taken care of. &lt;/p&gt;</comment>
                    <comment id="30580" author="jafingerhut" created="Wed, 13 Feb 2013 00:28:34 -0600"  >&lt;p&gt;clj-1073-add-print-interruptibly-patch-v2.txt dated Feb 12 2013 is identical to clj-1073-add-print-interruptibly-patch-v1.txt dated Nov 8 2012 (soon to be removed) except that it applies cleanly to latest master.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11517" name="0001-Allow-thread-interruption-in-print-sequential.patch" size="1260" author="trptcolin" created="Fri, 21 Sep 2012 16:10:46 -0500" />
                    <attachment id="11850" name="clj-1073-add-print-interruptibly-patch-v2.txt" size="3902" author="jafingerhut" created="Wed, 13 Feb 2013 00:28:34 -0600" />
                    <attachment id="11519" name="perftest-print.clj" size="284" author="jafingerhut" created="Fri, 21 Sep 2012 19:05:46 -0500" />
                    <attachment id="11518" name="test.sh" size="298" author="jafingerhut" created="Fri, 21 Sep 2012 19:05:34 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1100] Reader literals cannot contain periods</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1100</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;The LispReader tries to read a record instead of a literal if the tag contains periods:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L1171&quot;&gt;https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L1171&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Which effectively means that reader tags cannot contain periods.&lt;br/&gt;
The EDN spec is unclear on this: &lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;edn supports extensibility through a simple mechanism. # followed immediately by a symbol starting with an alphabetic character indicates that that symbol is a tag.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;(issue opened: &lt;a href=&quot;https://github.com/edn-format/edn/issues/39&quot;&gt;https://github.com/edn-format/edn/issues/39&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;If periods are allowed, then the LispReader should first check to see if the tag is in &lt;tt&gt;&amp;#42;data-readers&amp;#42;&lt;/tt&gt; and only then if not try to initialize a Java class.&lt;/p&gt;

&lt;p&gt;I&apos;m happy to write the patch if this behavior is what is desired.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15812">CLJ-1100</key>
            <summary>Reader literals cannot contain periods</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="lynaghk">Kevin Lynagh</reporter>
                        <labels>
                        <label>reader</label>
                    </labels>
                <created>Fri, 2 Nov 2012 23:57:22 -0500</created>
                <updated>Thu, 14 Feb 2013 15:04:53 -0600</updated>
                                                                            <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="29904" author="steveminer@gmail.com" created="Tue, 6 Nov 2012 09:41:44 -0600"  >&lt;p&gt;The suggested patch (clj-1100-reader-literal-periods.patch) will break reading records when &amp;#42;default-data-reader-fn* is set.  Try adding a test like this:&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;(deftest tags-containing-periods-with-&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;
      ;; we need a predefined record &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; test so we (mis)use clojure.reflect.Field &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; convenience
      (let [v &lt;span class=&quot;code-quote&quot;&gt;&quot;#clojure.reflect.Field{:name \&quot;&lt;/span&gt;fake\&lt;span class=&quot;code-quote&quot;&gt;&quot; :type :fake :declaring-class \&quot;&lt;/span&gt;Fake\&lt;span class=&quot;code-quote&quot;&gt;&quot; :flags nil}&quot;&lt;/span&gt;]
        (binding [*&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;-data-reader-fn* nil]
          (is (= (read-string v) #clojure.reflect.Field{:name &lt;span class=&quot;code-quote&quot;&gt;&quot;fake&quot;&lt;/span&gt; :type :fake :declaring-class &lt;span class=&quot;code-quote&quot;&gt;&quot;Fake&quot;&lt;/span&gt; :flags nil})))
        (binding [*&lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;-data-reader-fn* (fn [tag val] (assoc val :meaning 42))]
          (is (= (read-string v) #clojure.reflect.Field{:name &lt;span class=&quot;code-quote&quot;&gt;&quot;fake&quot;&lt;/span&gt; :type :fake :declaring-class &lt;span class=&quot;code-quote&quot;&gt;&quot;Fake&quot;&lt;/span&gt; :flags nil})))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="30085" author="richhickey" created="Thu, 29 Nov 2012 09:36:46 -0600"  >&lt;p&gt;The problem assessment is ok, but the resolution approach may not be. What happens should be based not upon what is in data-readers but whether or not the name names a class.&lt;/p&gt;

&lt;p&gt;Is the intent here to allow readers to circumvent records? I&apos;m not in favor of that.&lt;/p&gt;</comment>
                    <comment id="30098" author="steveminer@gmail.com" created="Thu, 29 Nov 2012 16:01:00 -0600"  >&lt;p&gt;New patch following Rich&apos;s comments.  The decision to read a record is now based on the symbol containing periods and not having a namespace.  Otherwise, it is considered a data reader tag.  User&lt;br/&gt;
defined tags are required to be qualified but they may now have periods in the name.  Tests added to show that&lt;br/&gt;
data readers cannot override record classes.  Note: Clojure-defined data reader tags may be unqualified, but they should not contain periods in order to avoid confusion with record classes.&lt;/p&gt;</comment>
                    <comment id="30100" author="steveminer@gmail.com" created="Thu, 29 Nov 2012 16:17:32 -0600"  >&lt;p&gt;I deleted my old patch and some comments referring to it to avoid confusion.&lt;/p&gt;

&lt;p&gt;In Clojure 1.5 beta 1, # followed by a qualified symbol with a period in the name is considered a record and causes an exception for the missing record class.  With the patch, only non-qualified symbols containing periods are considered records.  That allows user-defined qualified symbols with periods in their names to be used as data reader tags.&lt;/p&gt;</comment>
                    <comment id="30564" author="jafingerhut" created="Thu, 7 Feb 2013 09:05:09 -0600"  >&lt;p&gt;clj-1100-periods-in-data-reader-tags-patch-v2.txt dated Feb 7 2013 is identical to &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1100&quot; title=&quot;Reader literals cannot contain periods&quot;&gt;CLJ-1100&lt;/a&gt;-periods-in-data-reader-tags.patch dated Nov 29 2012, except it applies cleanly to latest master.  The only change appears to be in some white space in the context lines.&lt;/p&gt;</comment>
                    <comment id="30567" author="jafingerhut" created="Thu, 7 Feb 2013 12:53:25 -0600"  >&lt;p&gt;I&apos;ve removed clj-1100-periods-in-data-reader-tags-patch-v2.txt mentioned in the previous comment, because I learned that &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1100&quot; title=&quot;Reader literals cannot contain periods&quot;&gt;CLJ-1100&lt;/a&gt;-periods-in-data-reader-tags.patch dated Nov 29 2012 applies cleanly to latest master and passes all tests if you use this command to apply it.&lt;/p&gt;

&lt;p&gt;% git am --keep-cr -s --ignore-whitespace &amp;lt; &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1100&quot; title=&quot;Reader literals cannot contain periods&quot;&gt;CLJ-1100&lt;/a&gt;-periods-in-data-reader-tags.patch&lt;/p&gt;

&lt;p&gt;I&apos;ve already updated the JIRA workflow and screening patches wiki pages to mention this --ignore-whitespace option.&lt;/p&gt;</comment>
                    <comment id="30585" author="jafingerhut" created="Wed, 13 Feb 2013 11:31:03 -0600"  >&lt;p&gt;Both of the current patches, &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1100&quot; title=&quot;Reader literals cannot contain periods&quot;&gt;CLJ-1100&lt;/a&gt;-periods-in-data-reader-tags.patch dated Nov 29 2012, and clj-1100-reader-literal-periods.patch dated Nov 6 2012, fail to apply cleanly to latest master (1.5.0-RC15) as of today, although they did last week.  Given all of the changes around read / read-string and edn recently, they should probably be evaluated by their authors to see how they should be updated.&lt;/p&gt;</comment>
                    <comment id="30600" author="steveminer@gmail.com" created="Thu, 14 Feb 2013 12:23:26 -0600"  >&lt;p&gt;I deleted my patch: &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1100&quot; title=&quot;Reader literals cannot contain periods&quot;&gt;CLJ-1100&lt;/a&gt;-periods-in-data-reader-tags.patch.  clj-1100-reader-literal-periods.patch is clearly wrong, but the original author or an administrator has to delete that.&lt;/p&gt;</comment>
                    <comment id="30602" author="lynaghk" created="Thu, 14 Feb 2013 13:28:04 -0600"  >&lt;p&gt;I cannot figure out how to remove my attachment (clj-1100-reader-literal-periods.patch) in JIRA.&lt;/p&gt;</comment>
                    <comment id="30603" author="steveminer@gmail.com" created="Thu, 14 Feb 2013 13:43:45 -0600"  >&lt;p&gt;Downarrow (popup) menu to the right of the &quot;Attachments&quot; section.  Choose &quot;manager attachments&quot;.&lt;/p&gt;</comment>
                    <comment id="30604" author="lynaghk" created="Thu, 14 Feb 2013 14:02:50 -0600"  >&lt;p&gt;Great, thanks Steve. Are you going to take another pass at this issue, or should I give it a go?&lt;/p&gt;</comment>
                    <comment id="30605" author="steveminer@gmail.com" created="Thu, 14 Feb 2013 15:04:53 -0600"  >&lt;p&gt;Kevin, I&apos;m not planning to work on this right now as 1.5 is pretty much done.  It might be worthwhile discussing the issue a bit on the dev mailing list before working on a patch, but that&apos;s up to you.  I think my approach was correct, although now changes would have to be applied to both LispReader and EdnReader.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-1082] Subvecs of primitive vectors cannot be reduced</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1082</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;I could reproduce on current 10/05 git.&lt;/p&gt;

&lt;p&gt;Reduce doesn&apos;t work on subvecs of primitive vectors.&lt;br/&gt;
Root cause seems to be that RT/subvec and APersistentVector$SubVector make assumptions about implementation&lt;/p&gt;

&lt;p&gt;If reduce on a subvec doesn&apos;t work then neither will nice ops like fold.&lt;/p&gt;

&lt;p&gt;How to cause: &lt;/p&gt;

&lt;p&gt;(let &lt;span class=&quot;error&quot;&gt;&amp;#91;prim-vec (into (vector-of :long) (range 10000))&amp;#93;&lt;/span&gt;&lt;br/&gt;
  (reduce + (subvec prim-vec 1 500)))&lt;/p&gt;

&lt;p&gt;-&amp;gt;&amp;gt; ClassCastException clojure.core.Vec cannot be cast to clojure.lang.PersistentVector  clojure.lang.APersistentVector$SubVector.iterator (APersistentVector.java:523)&lt;/p&gt;
</description>
                <environment>1.7.0-08, OS X 10.8</environment>
            <key id="15733">CLJ-1082</key>
            <summary>Subvecs of primitive vectors cannot be reduced</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="gshayban">Ghadi Shayban</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Oct 2012 18:49:21 -0500</created>
                <updated>Sat, 26 Jan 2013 07:29:55 -0600</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="30056" author="halgari" created="Tue, 27 Nov 2012 11:52:48 -0600"  >&lt;p&gt;Confirmed to be broken on master. Vetting. Not sure what it&apos;s going to take to fix this, however. If this is of intrest for you, you might want to help push it along by providing a patch. &lt;/p&gt;</comment>
                    <comment id="30058" author="jafingerhut" created="Tue, 27 Nov 2012 12:09:26 -0600"  >&lt;p&gt;There is no code or ticket for this yet, but I wanted to mention that I&apos;ve begun working on an implementation of RRB-Tree (Relaxed Radix Balanced Tree) vectors for Clojure (see discussion at &lt;a href=&quot;https://groups.google.com/forum/?fromgroups=#!topic/clojure-dev/xnbtzTVEK9A&quot;&gt;https://groups.google.com/forum/?fromgroups=#!topic/clojure-dev/xnbtzTVEK9A&lt;/a&gt;).  Assuming it is no big deal to get reducers to work on such vectors, subvec could be implemented in O(log n) time in such a way that the result was the same concrete type of vector as you started with, and thus reducers would work on them, too.&lt;/p&gt;

&lt;p&gt;It would mean O(log n) time for subvec instead of today&apos;s O(1), but this would likely fix other limitations that exist today with subvec&apos;s, e.g. &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-761&quot; title=&quot;print-dup generates call to nonexistent method for APersistentVector$SubVector&quot;&gt;CLJ-761&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="30461" author="mikera" created="Sun, 20 Jan 2013 05:14:04 -0600"  >&lt;p&gt;I have a fix for this and a regression test in the tree below:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mikera/clojure/tree/winfix&quot;&gt;https://github.com/mikera/clojure/tree/winfix&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not sure how best to make this into a patch though - I also have the pprint fix in here (&lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1076&quot; title=&quot;pprint tests fail on Windows, expecting \n&quot;&gt;CLJ-1076&lt;/a&gt;)&lt;/p&gt;</comment>
                    <comment id="30462" author="mikera" created="Sun, 20 Jan 2013 18:41:50 -0600"  >&lt;p&gt;Attached a patch that I created with: &lt;/p&gt;

&lt;p&gt;git format-patch winfix --stdout HEAD~3..HEAD &amp;gt; clj-1082.patch&lt;/p&gt;

&lt;p&gt;Does this do the trick? I had to use the HEAD~3..HEAD to just get the most recent 3 commits and exclude the pprint changes that I needed in order to build on Windows.&lt;/p&gt;</comment>
                    <comment id="30463" author="mikera" created="Sun, 20 Jan 2013 18:42:24 -0600"  >&lt;p&gt;Patch for &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1082&quot; title=&quot;Subvecs of primitive vectors cannot be reduced&quot;&gt;CLJ-1082&lt;/a&gt;, containing 3 commits&lt;/p&gt;</comment>
                    <comment id="30465" author="jafingerhut" created="Mon, 21 Jan 2013 01:11:04 -0600"  >&lt;p&gt;Mike, your patch clj-1082.patch applies cleanly to latest master for me, so looks like you found one way to do it.&lt;/p&gt;

&lt;p&gt;Another would be as follows, and closer to the directions on the JIRA workflow page: &lt;a href=&quot;http://dev.clojure.org/display/design/JIRA+workflow&quot;&gt;http://dev.clojure.org/display/design/JIRA+workflow&lt;/a&gt; (but not identical).  Note that these commands would work on Mac OS X or Linux.  I&apos;m not sure what the correct corresponding command would be on Windows for the &quot;git am&quot; step below, unless that just happens to work because Windows and/or git implement the input redirection with &quot;&amp;lt;&quot; somehow.&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Check out a fresh repo&lt;br/&gt;
$ git clone git://github.com/clojure/clojure.git&lt;br/&gt;
$ cd clojure&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;Apply the patch for &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1076&quot; title=&quot;pprint tests fail on Windows, expecting \n&quot;&gt;CLJ-1076&lt;/a&gt; to the master branch.  This step isn&apos;t on the JIRA workflow page.&lt;br/&gt;
$ git am --keep-cr -s &amp;lt; clj-1076-fix-tests-on-windows-patch-v1.txt&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;Create a branch for yourself&lt;br/&gt;
$ git checkout -b fix-clj-1082&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;After editing to make your changes, commit them to the current fix-clj-1082 branch&lt;br/&gt;
$ git commit -a -m &quot;fixed annoying bug, refs #42&quot;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;From there on down it is the same as the instructions on the JIRA workflow page.  The &quot;git format-patch master --stdout &amp;gt; file.patch&quot; will create a patch for the changes you have made in the current branch fix-clj-1082 starting from the master branch, which has the &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1076&quot; title=&quot;pprint tests fail on Windows, expecting \n&quot;&gt;CLJ-1076&lt;/a&gt; fix because of the &apos;git am&apos; command above.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11807" name="clj-1082.patch" size="3892" author="mikera" created="Sun, 20 Jan 2013 18:42:24 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1033] pr-str and read-string don&apos;t handle @ symbols inside keywords properly</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1033</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&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=&amp;gt; (read-string (pr-str {(keyword &lt;span class=&quot;code-quote&quot;&gt;&quot;key@other&quot;&lt;/span&gt;) :stuff}))
RuntimeException Map literal must contain an even number of forms  clojure.lang.Util.runtimeException (Util.java:170)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;pr-str emits &quot;{:key@other :stuff}&quot;, which read-string fails to interpret correctly. Either pr-str needs to escape the @ symbol, or read-string needs to handle the symbol inside a keyword.&lt;/p&gt;

&lt;p&gt;Background: I&apos;m passing a map with email addresses as keys through Storm bolts, which require a thrift-serializable form. Using the pr-str/read-string combo fails on these keys, so I&apos;ve fallen back to JSON serialization. &lt;/p&gt;</description>
                <environment>Ubuntu 12.04 LTS; Java 1.7.0_05 Java HotSpot(TM) Client VM</environment>
            <key id="15600">CLJ-1033</key>
            <summary>pr-str and read-string don&apos;t handle @ symbols inside keywords properly</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="stevenruppert">Steven Ruppert</reporter>
                        <labels>
                        <label>reader</label>
                    </labels>
                <created>Thu, 26 Jul 2012 11:25:38 -0500</created>
                <updated>Sun, 13 Jan 2013 22:58:37 -0600</updated>
                                    <version>Release 1.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="29101" author="stu" created="Fri, 10 Aug 2012 12:51:33 -0500"  >&lt;p&gt;The &apos;@&apos; character is not a legal character for keywords or symbols (see &lt;a href=&quot;http://clojure.org/reader&quot;&gt;http://clojure.org/reader&lt;/a&gt;). Recategorized as enhancement request.&lt;/p&gt;</comment>
                    <comment id="29102" author="stevenruppert" created="Fri, 10 Aug 2012 13:04:23 -0500"  >&lt;p&gt;Then why doesn&apos;t (keyword &quot;keywith@&quot;) throw an exception? It seems inconsistent with your statement.&lt;/p&gt;</comment>
                    <comment id="29435" author="jafingerhut" created="Thu, 13 Sep 2012 14:23:29 -0500"  >&lt;p&gt;It is a long standing property of Clojure that it does not throw exceptions for everything that is illegal.&lt;/p&gt;</comment>
                    <comment id="29468" author="stevenruppert" created="Mon, 17 Sep 2012 14:16:01 -0500"  >&lt;p&gt;Yeah, but read-string clearly does. Is there a good reason that the &quot;keyword&quot; function &lt;em&gt;can&apos;t&lt;/em&gt; throw an exception? With the other special rules on namespaces within symbol names, the &quot;keyword&quot; function really should be doing validation.&lt;/p&gt;

&lt;p&gt;Another solution would be to allow a ruby-like :&quot;symbol with disallowed characters&quot; literal, but that would also be confusing with how the namespace is handled.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://groups.google.com/forum/?fromgroups=#!topic/clojure/Ct5v9w0yNAE&quot;&gt;https://groups.google.com/forum/?fromgroups=#!topic/clojure/Ct5v9w0yNAE&lt;/a&gt; has some older discussion on this topic. &lt;/p&gt;</comment>
                    <comment id="29471" author="jafingerhut" created="Mon, 17 Sep 2012 19:43:54 -0500"  >&lt;p&gt;Disclaimer: I&apos;m not a Clojure/core member, just an interested contributor who doesn&apos;t know all the design decisions that were made here.&lt;/p&gt;

&lt;p&gt;Steven, I think perhaps a couple of concerns are: (1) doing such checks would be slower than not doing them, and (2) implementing such checks means having to update them if/when the rules for legal symbols, keywords, namespace names, etc. change.&lt;/p&gt;

&lt;p&gt;Would you be interested in writing strict versions of functions like symbol and keyword for addition to a contrib library?  And test suites that try to hit a significant number of corner cases in the rules for what is legal and what is not?  I mean those as serious questions, not rhetorical ones.  This would permit people that want to use the strict versions of these functions to do so, and at the same time make it easy to measure performance differences between the strict and loose versions.&lt;/p&gt;</comment>
                    <comment id="30435" author="stevenruppert" created="Sun, 13 Jan 2013 22:58:37 -0600"  >&lt;p&gt;Looking back at this, the root cause of the problem is that the {pr} function, although it by default &quot;print&lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt; in a way that objects can be read by the reader&quot; &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;, doesn&apos;t always do so. Thus, the easiest &quot;fix&quot; is to change its docstring to warn that not all keywords can be read back.&lt;/p&gt;

&lt;p&gt;The deeper problem is that symbol don&apos;t have a reader form that can represent all actually possible keywords (in this case, those with &quot;@&quot; in them). Restricting the actually-possible keywords to match the reader form, i.e. writing a strict &quot;keyword&quot; &lt;b&gt;function&lt;/b&gt; actually seems like a worse solution overall to me. The better solution would be to somehow extend the keyword reader form to allow it to express all possible keywords, possibly ruby&apos;s :&quot;keyword&quot; syntax. Plus, that solution would avoid having to keep hypothetical strict keyword/symbol functions in sync with reader operation, and write test cases for that, and so on.&lt;/p&gt;

&lt;p&gt;Thus, the resolution of this bug comes down to how far we&apos;re willing to go. Changing the docstring would be the easiest, but extending the keyword form would be the &quot;best&quot; resolution, IMO.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;: &lt;a href=&quot;http://clojuredocs.org/clojure_core/clojure.core/pr&quot;&gt;http://clojuredocs.org/clojure_core/clojure.core/pr&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-1104] Concurrent with-redefs do not unwind properly, leaving a var permanently changed</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1104</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;On 1.4 and latest master:&lt;/p&gt;

&lt;p&gt;user&amp;gt; (defn ten [] 10)&lt;br/&gt;
#&apos;user/ten&lt;br/&gt;
user&amp;gt; (doall (pmap #(with-redefs [ten (fn [] %)] (ten)) (range 20 100)))&lt;br/&gt;
(20 21 22 23 24 25 34 27 28 29 30 31 32 33 34 35 36 37 38 39 39 35 42 43 44 45 48 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 79 87 88 89 90 91 92 93 94 95 97 92 98 99)&lt;br/&gt;
user&amp;gt; (ten)&lt;br/&gt;
79&lt;/p&gt;

&lt;p&gt;Not sure if this is a bug per se, but the doc doesn&apos;t mention lack of concurrency safety and my expectation was that the original value would always be restored after any (arbitrarily interleaved) sequence of with-redefs calls. &lt;/p&gt;</description>
                <environment>Mac OS, Java 6</environment>
            <key id="15816">CLJ-1104</key>
            <summary>Concurrent with-redefs do not unwind properly, leaving a var permanently changed</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="jawolfe">Jason Wolfe</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Nov 2012 17:46:19 -0600</created>
                <updated>Fri, 21 Dec 2012 23:05:10 -0600</updated>
                                    <version>Release 1.4</version>
                <version>Release 1.5</version>
                                <fixVersion>Approved Backlog</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="29907" author="timmc" created="Wed, 7 Nov 2012 20:50:49 -0600"  >&lt;p&gt;The with-redefs doc (v1.4.0) says &quot;These temporary changes will be visible in all threads.&quot; That sounds non-thread-safe to me.&lt;/p&gt;

&lt;p&gt;In general, changes to var root bindings are not thread safe.&lt;/p&gt;</comment>
                    <comment id="29908" author="bendlas" created="Thu, 8 Nov 2012 09:17:31 -0600"  >&lt;p&gt;As I understand it, with-redefs is mainly used in test suites to mock out vars. It was introduced when vars became static by default and a lot of testsuites had been using binding for mocking. Maybe the docstring should be amended with something along the lines of: When using this you have to ensure that only a single thread is interacting with redef&apos;d vars.&lt;/p&gt;</comment>
                    <comment id="30030" author="stu" created="Sun, 25 Nov 2012 18:41:17 -0600"  >&lt;p&gt;Behavior find as is, doc string change would be fine.&lt;/p&gt;</comment>
                    <comment id="30032" author="jafingerhut" created="Sun, 25 Nov 2012 18:57:16 -0600"  >&lt;p&gt;Patch clj-1104-doc-unsafety-of-concurrent-with-redefs-v1.txt dated Nov 25 2012 updates doc string of with-redefs to make it clear that concurrent use is unsafe.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11708" name="clj-1104-doc-unsafety-of-concurrent-with-redefs-v1.txt" size="1091" author="jafingerhut" created="Sun, 25 Nov 2012 18:57:16 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1059] PersistentQueue doesn&apos;t implement java.util.List, causing nontransitive equality</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1059</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;PersistentQueue implements Sequential but doesn&apos;t implement java.util.List. Lists form an equality partition, as do Sequentials. This means that you can end up with nontransitive equality:&lt;/p&gt;

&lt;p&gt;(def q (conj clojure.lang.PersistentQueue/EMPTY 1 2 3))&lt;br/&gt;
;=&amp;gt; #user/q&lt;br/&gt;
(def al (doto (java.util.ArrayList.) (.add 1) (.add 2) (.add 3)))&lt;br/&gt;
;=&amp;gt; #user/al&lt;br/&gt;
(def v &lt;span class=&quot;error&quot;&gt;&amp;#91;1 2 3&amp;#93;&lt;/span&gt;)&lt;br/&gt;
;=&amp;gt; #user/v&lt;br/&gt;
(= al v)&lt;br/&gt;
;=&amp;gt; true&lt;br/&gt;
(= v q)&lt;br/&gt;
;=&amp;gt; true&lt;br/&gt;
(not= al q)&lt;br/&gt;
;=&amp;gt; true&lt;/p&gt;

&lt;p&gt;This happens because PersistentQueue is a Sequential but not a List, ArrayList is a List but not a Sequential, and PersistentVector is both.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15669">CLJ-1059</key>
            <summary>PersistentQueue doesn&apos;t implement java.util.List, causing nontransitive equality</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="ppotter">Philip Potter</assignee>
                                <reporter username="ppotter">Philip Potter</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Sep 2012 04:23:59 -0500</created>
                <updated>Tue, 11 Dec 2012 13:58:01 -0600</updated>
                                    <version>Release 1.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="29446" author="ppotter" created="Sat, 15 Sep 2012 03:41:15 -0500"  >&lt;p&gt;Whoops, according to &lt;a href=&quot;http://dev.clojure.org/display/design/JIRA+workflow&quot;&gt;http://dev.clojure.org/display/design/JIRA+workflow&lt;/a&gt; I should have emailed clojure-dev before filing this ticket. Here is the discussion:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://groups.google.com/d/topic/clojure-dev/ME3-Ke-RbNk/discussion&quot;&gt;https://groups.google.com/d/topic/clojure-dev/ME3-Ke-RbNk/discussion&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="29452" author="ppotter" created="Sat, 15 Sep 2012 14:37:49 -0500"  >&lt;p&gt;Attached 001-make-PersistentQueue-implement-List.diff, 15/Sep/12&lt;/p&gt;

&lt;p&gt;Note that this patch has a minor conflict with the one I added to &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1070&quot; title=&quot;PersistentQueue&amp;#39;s hash function does not match its equality&quot;&gt;&lt;del&gt;CLJ-1070&lt;/del&gt;&lt;/a&gt;, because both add an extra interface to PersistentQueue - List in this case, IHashEq in &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1070&quot; title=&quot;PersistentQueue&amp;#39;s hash function does not match its equality&quot;&gt;&lt;del&gt;CLJ-1070&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="29473" author="chouser@n01se.net" created="Tue, 18 Sep 2012 01:04:48 -0500"  >&lt;p&gt;Philip, patch looks pretty good &amp;#8211; thanks for doing this.  A couple notes:&lt;/p&gt;

&lt;p&gt;This is only my opinion, but I prefer imports be listed without wildcards, even if it means an extra couple lines at the top of a .java file.&lt;/p&gt;

&lt;p&gt;I noticed the &quot;List stuff&quot; code is a copy of what&apos;s in ASeq and EmptyList.  I suppose this is copied because EmptyList and PersistentQueue extend Obj and therefore can&apos;t extend ASeq.  Is this the only reason?  It seems a shame to duplicate these method definitions, but I don&apos;t know of a better solution, do you?&lt;/p&gt;

&lt;p&gt;It would also be nice if the test check a couple of the List methods you&apos;ve implemented.&lt;/p&gt;</comment>
                    <comment id="29474" author="chouser@n01se.net" created="Tue, 18 Sep 2012 01:08:26 -0500"  >&lt;p&gt;oh, also &quot;git am&quot; refused to apply the patch, but I&apos;m not sure why.  &quot;patch -p 1&quot; worked perfectly.&lt;/p&gt;</comment>
                    <comment id="29475" author="ppotter" created="Tue, 18 Sep 2012 01:19:11 -0500"  >&lt;p&gt;did you use the --keep-cr option to git am?&lt;/p&gt;

&lt;p&gt;I struggled to know whether I should be adding CRs or not to line endings, because the files I was editing weren&apos;t consistent in their usage. If you open them in emacs, half the lines have ^M at the end.&lt;/p&gt;</comment>
                    <comment id="29476" author="ppotter" created="Tue, 18 Sep 2012 01:21:23 -0500"  >&lt;p&gt;Will submit another patch, with the import changed. I&apos;ll have a think about the list implementation and see what ideas I can come up with.&lt;/p&gt;</comment>
                    <comment id="29487" author="ppotter" created="Tue, 18 Sep 2012 15:17:17 -0500"  >&lt;p&gt;Attached 002-make-PersistentQueue-implement-Asequential.diff&lt;/p&gt;

&lt;p&gt;This patch is an alternative to 001-make-PersistentQueue-implement-List.diff&lt;/p&gt;

&lt;p&gt;So I took on board what you said about ASeq, but it didn&apos;t feel right making PersistentQueue directly implement ISeq, somehow.&lt;/p&gt;

&lt;p&gt;So I split ASeq into two parts &amp;#8211; ASequential, which implements j.u.{Collection,List} and manages List-equality and hashcodes; and ASeq, which... doesn&apos;t seem to be doing much anymore, to be honest.&lt;/p&gt;

&lt;p&gt;As a bonus, this patch fixes &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1070&quot; title=&quot;PersistentQueue&amp;#39;s hash function does not match its equality&quot;&gt;&lt;del&gt;CLJ-1070&lt;/del&gt;&lt;/a&gt; too, so I went and added the tests from that ticket in to demonstrate this fact. It also tidies up PersistentQueue by removing all equals/hashcCode stuff and all Collection stuff.&lt;/p&gt;

&lt;p&gt;(It turns out that because ASeq was already implementing Obj, the fact that PersistentQueue was implementing Obj was no barrier to using it.)&lt;/p&gt;

&lt;p&gt;Would appreciate comments on this approach, and how it differs from the previous patch here and the patch on &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1070&quot; title=&quot;PersistentQueue&amp;#39;s hash function does not match its equality&quot;&gt;&lt;del&gt;CLJ-1070&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="29488" author="ppotter" created="Tue, 18 Sep 2012 15:44:45 -0500"  >&lt;p&gt;Looking at EmptyList&apos;s implementation of List, it is a duplicate of the others, but it shouldn&apos;t be. I think its implementation of indexOf is the biggest culprit - it should just be &apos;return -1;&apos; but it has a great big for loop! But this is beyond the scope of this ticket, so I won&apos;t patch that here.&lt;/p&gt;</comment>
                    <comment id="29731" author="jafingerhut" created="Sat, 20 Oct 2012 12:29:16 -0500"  >&lt;p&gt;Philip, now that the patch for &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1070&quot; title=&quot;PersistentQueue&amp;#39;s hash function does not match its equality&quot;&gt;&lt;del&gt;CLJ-1070&lt;/del&gt;&lt;/a&gt; has been applied, these patches no longer apply cleanly.  Would you be willing to update them?  If so, please remove the obsolete patches.&lt;/p&gt;</comment>
                    <comment id="29747" author="ppotter" created="Mon, 22 Oct 2012 05:10:16 -0500"  >&lt;p&gt;Andy, thanks so much for your efforts to make people aware of these things. I will indeed submit new patches, hopefully later this week.&lt;/p&gt;</comment>
                    <comment id="29899" author="ppotter" created="Sat, 3 Nov 2012 12:23:20 -0500"  >&lt;p&gt;Replaced existing patches with new ones which apply cleanly to master.&lt;/p&gt;

&lt;p&gt;There are two patches:&lt;/p&gt;

&lt;p&gt;001-clj-1059-make-persistentqueue-implement-list.diff&lt;/p&gt;

&lt;p&gt;This fixes equality by making PersistentQueue implement List directly. I also took the opportunity to remove the wildcard import and to add tests for the List methods, as compared with the previous version of the patch.&lt;/p&gt;

&lt;p&gt;002-clj-1059-asequential.diff&lt;/p&gt;

&lt;p&gt;This fixes equality by creating a new abstract class ASequential, and making PersistentQueue extend this.&lt;/p&gt;

&lt;p&gt;My preferred solution is still the ASequential patch, but I&apos;m leaving both here for comparison.&lt;/p&gt;</comment>
                    <comment id="30123" author="halgari" created="Fri, 30 Nov 2012 15:37:33 -0600"  >&lt;p&gt;Vetting. &lt;/p&gt;</comment>
                    <comment id="30214" author="jafingerhut" created="Tue, 11 Dec 2012 12:50:19 -0600"  >&lt;p&gt;Philip, this time I think it was patches that were committed for &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1000&quot; title=&quot;Performance drop in PersistentHashMap.valAt(...) in v.1.4 -- Util.hasheq(...) ?&quot;&gt;&lt;del&gt;CLJ-1000&lt;/del&gt;&lt;/a&gt; that make your patch 002-clj-1059-asequential.diff not apply cleanly.  I often fix up stale patches where the change is straightforward and mechanical, but in this case you are moving some methods that &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1000&quot; title=&quot;Performance drop in PersistentHashMap.valAt(...) in v.1.4 -- Util.hasheq(...) ?&quot;&gt;&lt;del&gt;CLJ-1000&lt;/del&gt;&lt;/a&gt;&apos;s patch changed the implementation of, so it would be best if someone figured out a way to update this patch in a way that doesn&apos;t clobber the &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1000&quot; title=&quot;Performance drop in PersistentHashMap.valAt(...) in v.1.4 -- Util.hasheq(...) ?&quot;&gt;&lt;del&gt;CLJ-1000&lt;/del&gt;&lt;/a&gt; changes.&lt;/p&gt;</comment>
                    <comment id="30216" author="ppotter" created="Tue, 11 Dec 2012 13:57:21 -0600"  >&lt;p&gt;Thanks Andy. Submitted a new patch, 002-clj-1059-asequential-rebased-to-cached-hasheq.diff, which supersedes 002-clj-1059-asequential.diff.&lt;/p&gt;

&lt;p&gt;The patch 001-clj-1059-make-persistentqueue-implement-list.diff still applies cleanly, and is still an alternative to 002-clj-1059-asequential-rebased-to-cached-hasheq.diff.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11660" name="001-clj-1059-make-persistentqueue-implement-list.diff" size="4129" author="ppotter" created="Sat, 3 Nov 2012 12:23:20 -0500" />
                    <attachment id="11755" name="002-clj-1059-asequential-rebased-to-cached-hasheq.diff" size="14108" author="ppotter" created="Tue, 11 Dec 2012 13:57:21 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1102] Better handling of exceptions with empty stack traces</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1102</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;I don&apos;t know what I did to cause some exceptions to be thrown while running Clojure tests that return a length 0 array from (.getStackTrace throwable), but according to the Java docs this is legal.  I searched all places in the Clojure code that call .getStackTrace and found two that don&apos;t handle this correctly, one of which causes an ArrayOutOfBoundsException (that is the one I found during my testing).&lt;/p&gt;</description>
                <environment></environment>
            <key id="15814">CLJ-1102</key>
            <summary>Better handling of exceptions with empty stack traces</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="jafingerhut">Andy Fingerhut</reporter>
                        <labels>
                    </labels>
                <created>Sun, 4 Nov 2012 17:03:47 -0600</created>
                <updated>Fri, 30 Nov 2012 14:57:46 -0600</updated>
                                    <version>Release 1.5</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="29900" author="jafingerhut" created="Sun, 4 Nov 2012 17:07:36 -0600"  >&lt;p&gt;clj-1102-improve-empty-stack-trace-handling-v1.txt dated Nov 4 2012 improves the handling of .getStackTrace returning a length 0 array in two places.  I checked all other places .getStackTrace was called and they seem to already handle this case gracefully.&lt;/p&gt;</comment>
                    <comment id="30120" author="halgari" created="Fri, 30 Nov 2012 14:57:37 -0600"  >&lt;p&gt;Vetting.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11662" name="clj-1102-improve-empty-stack-trace-handling-v1.txt" size="1791" author="jafingerhut" created="Sun, 4 Nov 2012 17:07:36 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1090] Indirect function calls through Var instances fail to clear locals</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1090</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;If you make a function call indirectly by invoking a Var object (which derefs itself and invokes the result), the invocation parameters remain in the thread&apos;s local stack for the duration of the function call, even though they are needed only long enough to be passed into the deref&apos;d function. As a result, passing a lazy seq into a function invoked in its Var form may run out of memory if the seq is forced inside that function. For example:&lt;/p&gt;

&lt;p&gt;(defn total &lt;span class=&quot;error&quot;&gt;&amp;#91;xs&amp;#93;&lt;/span&gt; (reduce + 0 xs))&lt;br/&gt;
(total (range 1000000000))   ; this works, though takes a while&lt;br/&gt;
(#&apos;total (range 1000000000)) ; this dies with out of memory error&lt;/p&gt;

&lt;p&gt;I can provide a patch if it would be useful. The fix should be trivial, something along the lines of wrapping each argN in clojure/lang/Var.java inside a Util.ret1(argN, argN = null) as is done in RestFn.java.&lt;/p&gt;</description>
                <environment>Probably all, but observed on Ubuntu 12.04, OpenJDK 6</environment>
            <key id="15768">CLJ-1090</key>
            <summary>Indirect function calls through Var instances fail to clear locals</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="stfactual">Spencer Tipping</reporter>
                        <labels>
                        <label>performance</label>
                    </labels>
                <created>Mon, 22 Oct 2012 18:43:19 -0500</created>
                <updated>Fri, 30 Nov 2012 14:26:45 -0600</updated>
                                    <version>Release 1.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="29776" author="stfactual" created="Tue, 23 Oct 2012 13:37:16 -0500"  >&lt;p&gt;Sorry, I typo&apos;d the example. (defn total ...) should be (defn sum ...).&lt;/p&gt;</comment>
                    <comment id="30054" author="halgari" created="Tue, 27 Nov 2012 11:45:43 -0600"  >&lt;p&gt;fixed typeo in example&lt;/p&gt;</comment>
                    <comment id="30055" author="halgari" created="Tue, 27 Nov 2012 11:47:35 -0600"  >&lt;p&gt;Couldn&apos;t reproduce the exception, but the 2nd example did chew through about 4x the amount of memory. Vetting. &lt;/p&gt;</comment>
                    <comment id="30095" author="halgari" created="Thu, 29 Nov 2012 14:57:28 -0600"  >&lt;p&gt;adding a patch. Since most of Clojure ends up running this code in one way or another, I&apos;d assert that tests are included as part of the normal Clojure test process. &lt;/p&gt;

&lt;p&gt;Patch simply calls Util.ret1(argx, argx=null) on all invoke calls. &lt;/p&gt;</comment>
                    <comment id="30097" author="halgari" created="Thu, 29 Nov 2012 15:17:52 -0600"  >&lt;p&gt;And as a note, both examples in the original report now have extremely similar memory usages. &lt;/p&gt;</comment>
                    <comment id="30118" author="stfactual" created="Fri, 30 Nov 2012 14:22:14 -0600"  >&lt;p&gt;Sounds great, and the patch looks good too. Let me know if I need to do anything else.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11729" name="var-clear-locals.diff" size="19020" author="halgari" created="Thu, 29 Nov 2012 14:57:28 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1056] defprotocol: invalid method overload syntax getting accepted </title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1056</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;The compiler accepts both of these erroneous forms which while silly, are not imposible to come up with.&lt;/p&gt;

&lt;p&gt;(defprotocol Foo (f (&lt;span class=&quot;error&quot;&gt;&amp;#91;this&amp;#93;&lt;/span&gt;) (&lt;span class=&quot;error&quot;&gt;&amp;#91;this arg&amp;#93;&lt;/span&gt;)))&lt;br/&gt;
(defprotocol Bar (m &lt;span class=&quot;error&quot;&gt;&amp;#91;this&amp;#93;&lt;/span&gt;) (m &lt;span class=&quot;error&quot;&gt;&amp;#91;this arg&amp;#93;&lt;/span&gt;))&lt;/p&gt;</description>
                <environment></environment>
            <key id="15665">CLJ-1056</key>
            <summary>defprotocol: invalid method overload syntax getting accepted </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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="vemv">V&#237;ctor M. Valenzuela</reporter>
                        <labels>
                    </labels>
                <created>Sat, 1 Sep 2012 19:19:17 -0500</created>
                <updated>Thu, 29 Nov 2012 16:03:11 -0600</updated>
                                    <version>Release 1.5</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="30099" author="halgari" created="Thu, 29 Nov 2012 16:02:50 -0600"  >&lt;p&gt;Can not reproduce the fist error:&lt;/p&gt;

&lt;p&gt;user=&amp;gt; (defprotocol Foo (f (&lt;span class=&quot;error&quot;&gt;&amp;#91;this&amp;#93;&lt;/span&gt;) (&lt;span class=&quot;error&quot;&gt;&amp;#91;this arg&amp;#93;&lt;/span&gt;)))    &lt;br/&gt;
CompilerException java.lang.IllegalArgumentException: Parameter declaration missing, compiling:(NO_SOURCE_PATH:5:1) &lt;/p&gt;

&lt;p&gt;But the 2nd one I can reproduce:&lt;/p&gt;

&lt;p&gt;user=&amp;gt; (defprotocol Bar (m &lt;span class=&quot;error&quot;&gt;&amp;#91;this&amp;#93;&lt;/span&gt;) (m &lt;span class=&quot;error&quot;&gt;&amp;#91;this arg&amp;#93;&lt;/span&gt;))    &lt;br/&gt;
Bar&lt;br/&gt;
user=&amp;gt; Bar&lt;br/&gt;
{:on-interface user.Bar, :on user.Bar, :sigs {:m {:doc nil, :arglists (&lt;span class=&quot;error&quot;&gt;&amp;#91;this arg&amp;#93;&lt;/span&gt;), :name m}}, :var #&apos;user/Bar, :method-map {:m :m}, :method-builders {#&apos;user/m #&amp;lt;user$eval71$fn_&lt;em&gt;72 user$eval71$fn&lt;/em&gt;_72@1a2b53fb&amp;gt;}}&lt;br/&gt;
user=&amp;gt; &lt;/p&gt;

&lt;p&gt;Notice that :arglists only has one entry&lt;/p&gt;

&lt;p&gt;Vetting&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-992] `iterate` reducer</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-992</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Added a reducer implementation mirroring clojure.core/iterate. &lt;/p&gt;</description>
                <environment></environment>
            <key id="15430">CLJ-992</key>
            <summary>`iterate` reducer</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="amalloy">Alan Malloy</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 May 2012 21:40:46 -0500</created>
                <updated>Fri, 12 Oct 2012 08:10:52 -0500</updated>
                                    <version>Release 1.5</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="28441" author="amalloy" created="Thu, 10 May 2012 21:50:25 -0500"  >&lt;p&gt;Should I have made this implement Seqable as well? It wasn&apos;t clear to me, because as far as I could see this was the only function in clojure.core.reducers that&apos;s generating a brand-new sequence rather than transforming an existing one.&lt;/p&gt;</comment>
                    <comment id="28442" author="amalloy" created="Thu, 10 May 2012 22:24:14 -0500"  >&lt;p&gt;Previous version neglected to include the seed value of the iteration in the reduce.&lt;/p&gt;</comment>
                    <comment id="28458" author="jasonjckn" created="Fri, 11 May 2012 11:23:05 -0500"  >&lt;p&gt;Currying iterate seems useless, albeit not harmful. &lt;/p&gt;

&lt;p&gt;While implementing repeat, I couldn&apos;t use currying. Because 1-arity is already reserved for infinite repeat (&lt;span class=&quot;error&quot;&gt;&amp;#91;n x&amp;#93;&lt;/span&gt; and &lt;span class=&quot;error&quot;&gt;&amp;#91;x&amp;#93;&lt;/span&gt;, not &lt;span class=&quot;error&quot;&gt;&amp;#91;n x&amp;#93;&lt;/span&gt; and &lt;span class=&quot;error&quot;&gt;&amp;#91;n&amp;#93;&lt;/span&gt; if currying)&lt;/p&gt;

&lt;p&gt;How about we just support currying for functions where last param is reducible?&lt;/p&gt;</comment>
                    <comment id="29226" author="amalloy" created="Sat, 18 Aug 2012 19:16:21 -0500"  >&lt;p&gt;This new patch replaces the previous patch. As requested, I am splitting up the large issue &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-993&quot; title=&quot;`range` reducer&quot;&gt;CLJ-993&lt;/a&gt; into smaller tickets.&lt;/p&gt;

&lt;p&gt;Does not depend on any of my other reducer patches, but there will probably be some minor merge conflicts unless it is merged after &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1045&quot; title=&quot;Generalize/refactor implementation of PersistentVector/coll-fold&quot;&gt;CLJ-1045&lt;/a&gt; and &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1046&quot; title=&quot;Drop-while as a reducer&quot;&gt;CLJ-1046&lt;/a&gt;, and before &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-993&quot; title=&quot;`range` reducer&quot;&gt;CLJ-993&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11192" name="0001-Add-reducers-iterate.patch" size="2029" author="amalloy" created="Thu, 10 May 2012 22:24:14 -0500" />
                    <attachment id="11446" name="iterate-reducer.patch" size="2209" author="amalloy" created="Sat, 18 Aug 2012 19:16:21 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</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>
                                                                                        </customfields>
    </item>

<item>
            <title>[CLJ-1039] Using &apos;def with metadata {:type :anything} throws ClassCastException</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1039</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;In lein 1.7.1 (and CCW) the form (def ^{:type :anything} mydef 1) throws &quot;ClassCastException clojure.lang.Var cannot be cast to clojure.lang.IObj  clojure.core/with-meta (core.clj:211)&quot;.&lt;br/&gt;
This seems to be due to setting the :type metadata. With other metadata keys it works well.&lt;/p&gt;

&lt;p&gt;If it is intended to forbid setting the :type metadata, then there should be an appropriate error message instead of the ClassCastException&lt;/p&gt;


&lt;p&gt;In lein2 repl which is using &quot;REPL-y 0.1.0-beta8&quot; the exception does not occur.&lt;/p&gt;

&lt;p&gt;Full stacktrace:&lt;br/&gt;
java.lang.ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.IObj&lt;br/&gt;
 at clojure.core$with_meta.invoke (core.clj:211)&lt;br/&gt;
    clojure.core$vary_meta.doInvoke (core.clj:617)&lt;br/&gt;
    clojure.lang.RestFn.invoke (RestFn.java:425)&lt;br/&gt;
    clojure.core/fn (core_print.clj:76)&lt;br/&gt;
    clojure.lang.MultiFn.invoke (MultiFn.java:167)&lt;br/&gt;
    clojure.core$pr_on.invoke (core.clj:3266)&lt;br/&gt;
    clojure.core$pr.invoke (core.clj:3278)&lt;br/&gt;
    clojure.lang.AFn.applyToHelper (AFn.java:161)&lt;br/&gt;
    clojure.lang.RestFn.applyTo (RestFn.java:132)&lt;br/&gt;
    clojure.core$apply.invoke (core.clj:601)&lt;br/&gt;
    clojure.core$prn.doInvoke (core.clj:3311)&lt;br/&gt;
    clojure.lang.RestFn.invoke (RestFn.java:408)&lt;br/&gt;
    clojure.main$repl$read_eval_print__6405.invoke (main.clj:246)&lt;br/&gt;
    clojure.main$repl$fn__6410.invoke (main.clj:266)&lt;br/&gt;
    clojure.main$repl.doInvoke (main.clj:266)&lt;br/&gt;
    clojure.lang.RestFn.invoke (RestFn.java:512)&lt;br/&gt;
    user$eval27$acc_&lt;em&gt;3261&lt;/em&gt;&lt;em&gt;auto&lt;/em&gt;__&lt;em&gt;30$fn&lt;/em&gt;_32.invoke (NO_SOURCE_FILE:1)&lt;br/&gt;
    clojure.lang.AFn.run (AFn.java:24)&lt;br/&gt;
    java.lang.Thread.run (Thread.java:662)&lt;/p&gt;</description>
                <environment>Ubuntu, lein 1.7.1 - lein repl</environment>
            <key id="15618">CLJ-1039</key>
            <summary>Using &apos;def with metadata {:type :anything} throws ClassCastException</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="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="gv">Gunnar V&#246;lkel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Aug 2012 06:05:34 -0500</created>
                <updated>Fri, 10 Aug 2012 13:40:31 -0500</updated>
                                    <version>Release 1.4</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="29106" author="stu" created="Fri, 10 Aug 2012 13:40:31 -0500"  >&lt;p&gt;This is caused by the printer dispatch function&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;(defmulti print-method (fn [x writer]
                         (let [t (get (meta x) :type)]
                           (if (keyword? t) t (class x)))))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which ends up calling the default dispatch, which tries to vary-meta.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-731] Create macro to variadically unroll a combinator function definition</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-731</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Clojure contains a set of combinators that are implemented in a similar, but slightly different way.  That is, they are implemented as a complete set of variadic overloads on both the call-side and also on the functions that they return.  Visually, they all tend to look something like:&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;(defn foo
  ([f]
     (fn
       ([] do stuff...)
       ([x] do stuff...)
       ([x y] do stuff...)
       ([x y z] do stuff...)
       ([x y z &amp;amp; args] do variadic stuff...)))
  ([f1 f2]
     (fn
       ([] do stuff...)
       ([x] do stuff...)
       ([x y] do stuff...)
       ([x y z] do stuff...)
       ([x y z &amp;amp; args] do variadic stuff...)))
  ([f1 f2 f3]
     (fn
       ([] do stuff...)
       ([x] do stuff...)
       ([x y] do stuff...)
       ([x y z] do stuff...)
       ([x y z &amp;amp; args] do variadic stuff...)))
  ([f1 f2 f3 &amp;amp; fs]
     (fn
       ([] do stuff...)
       ([x] do stuff...)
       ([x y] do stuff...)
       ([x y z] do stuff...)
       ([x y z &amp;amp; args] do variadic stuff...))))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To build this type of function for each combinator is tedious and error-prone.&lt;/p&gt;

&lt;p&gt;There must be a way to implement a macro that takes a &quot;specification&quot; of a combinator including:&lt;/p&gt;

&lt;p&gt;1. name&lt;br/&gt;
2. docstring&lt;br/&gt;
3. do stuff template&lt;br/&gt;
4. do variadic stuff template&lt;/p&gt;

&lt;p&gt;And builds something like the function &lt;tt&gt;foo&lt;/tt&gt; above.  This macro should be able to implement the current batch of combinators (assuming that &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-730&quot;&gt;http://dev.clojure.org/jira/browse/CLJ-730&lt;/a&gt; is completed first for the sake of verification).&lt;/p&gt;</description>
                <environment></environment>
            <key id="14344">CLJ-731</key>
            <summary>Create macro to variadically unroll a combinator function definition</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="fogus">Fogus</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Jan 2011 12:00:01 -0600</created>
                <updated>Fri, 28 Jan 2011 09:40:05 -0600</updated>
                                                    <fixVersion>Approved Backlog</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="26181" author="stu" created="Fri, 28 Jan 2011 09:03:46 -0600"  >&lt;p&gt;This seems useful. Rich, would you accept a patch?&lt;/p&gt;</comment>
                    <comment id="26185" author="stu" created="Fri, 28 Jan 2011 09:40:05 -0600"  >&lt;p&gt;Nevermind, just saw that Rich already suggested this on the dev list. Patch away.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-47] GC Issue 43: Dead code in generated bytecode</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-47</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&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;Reported by Levente.Santha, Jan 11, 2009
The bug was described in detail in &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; thread: http:&lt;span class=&quot;code-comment&quot;&gt;//groups.google.com/
&lt;/span&gt;group/clojure/browse_thread/thread/81ba15d7e9130441

For clojure.core$last__2954.invoke the correct bytecode would be (notice 
the removed &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt;    65&quot;&lt;/span&gt; after &lt;span class=&quot;code-quote&quot;&gt;&quot;41:  &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt;    0&quot;&lt;/span&gt;):

&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; java.lang.&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; invoke(java.lang.&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;)   &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; 
java.lang.Exception;
  Code:
   0:   getstatic       #22; &lt;span class=&quot;code-comment&quot;&gt;//Field const__0:Lclojure/lang/Var;
&lt;/span&gt;   3:   invokevirtual   #37; &lt;span class=&quot;code-comment&quot;&gt;//Method clojure/lang/Var.get:()Ljava/lang/
&lt;/span&gt;&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;;
   6:   checkcast       #39; &lt;span class=&quot;code-comment&quot;&gt;//class clojure/lang/IFn
&lt;/span&gt;   9:   aload_1
   10:  invokeinterface #41,  2; &lt;span class=&quot;code-comment&quot;&gt;//InterfaceMethod clojure/lang/IFn.invoke:
&lt;/span&gt;(Ljava/lang/&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;;)Ljava/lang/&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;;
   15:  dup
   16:  ifnull  44
   19:  getstatic       #47; &lt;span class=&quot;code-comment&quot;&gt;//Field java/lang/&lt;span class=&quot;code-object&quot;&gt;Boolean&lt;/span&gt;.FALSE:Ljava/lang/
&lt;/span&gt;&lt;span class=&quot;code-object&quot;&gt;Boolean&lt;/span&gt;;
   22:  if_acmpeq       45
   25:  getstatic       #22; &lt;span class=&quot;code-comment&quot;&gt;//Field const__0:Lclojure/lang/Var;
&lt;/span&gt;   28:  invokevirtual   #37; &lt;span class=&quot;code-comment&quot;&gt;//Method clojure/lang/Var.get:()Ljava/lang/
&lt;/span&gt;&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;;
   31:  checkcast       #39; &lt;span class=&quot;code-comment&quot;&gt;//class clojure/lang/IFn
&lt;/span&gt;   34:  aload_1
   35:  invokeinterface #41,  2; &lt;span class=&quot;code-comment&quot;&gt;//InterfaceMethod clojure/lang/IFn.invoke:
&lt;/span&gt;(Ljava/lang/&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;;)Ljava/lang/&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;;
   40:  astore_1
   41:  &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt;    0
   44:  pop
   45:  getstatic       #26; &lt;span class=&quot;code-comment&quot;&gt;//Field const__1:Lclojure/lang/Var;
&lt;/span&gt;   48:  invokevirtual   #37; &lt;span class=&quot;code-comment&quot;&gt;//Method clojure/lang/Var.get:()Ljava/lang/
&lt;/span&gt;&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;;
   51:  checkcast       #39; &lt;span class=&quot;code-comment&quot;&gt;//class clojure/lang/IFn
&lt;/span&gt;   54:  aload_1
   55:  aconst_null
   56:  astore_1
   57:  invokeinterface #41,  2; &lt;span class=&quot;code-comment&quot;&gt;//InterfaceMethod clojure/lang/IFn.invoke:
&lt;/span&gt;(Ljava/lang/&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;;)Ljava/lang/&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;;
   62:  areturn

Our JIT reported incorrect stack size along the basic block introduced by 
the unneeded &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt;.
The bug was present in SVN rev 1205.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13444">CLJ-47</key>
            <summary>GC Issue 43: Dead code in generated bytecode</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                        <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="-1">None</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Jun 2009 15:18:00 -0500</created>
                <updated>Fri, 8 Oct 2010 10:21:00 -0500</updated>
                                                    <fixVersion>Approved Backlog</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="22584" author="importer" created="Fri, 8 Oct 2010 10:21:00 -0500"  >&lt;p&gt;Converted from &lt;a href=&quot;http://www.assembla.com/spaces/clojure/tickets/47&quot;&gt;http://www.assembla.com/spaces/clojure/tickets/47&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="22585" author="importer" created="Fri, 8 Oct 2010 10:21:00 -0500"  >&lt;p&gt;richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124)&lt;/p&gt;</comment>
                    <comment id="22586" author="importer" created="Fri, 8 Oct 2010 10:21:00 -0500"  >&lt;p&gt;aredington said: This appears to still be a problem with the generated bytecode in 1.3.0. Examining the bytecode for last, the problem has moved to invokeStatic:&lt;/p&gt;

&lt;p&gt;&amp;lt;pre&amp;gt;&lt;br/&gt;
public static java.lang.Object invokeStatic(java.lang.Object)   throws java.lang.Exception;&lt;br/&gt;
  Code:&lt;br/&gt;
   0: aload_0&lt;br/&gt;
   1: invokestatic #50; //Method clojure/core$next.invokeStatic:(Ljava/lang/Object;)Ljava/lang/Object;&lt;br/&gt;
   4: dup&lt;br/&gt;
   5: ifnull 25&lt;br/&gt;
   8: getstatic #56; //Field java/lang/Boolean.FALSE:Ljava/lang/Boolean;&lt;br/&gt;
   11: if_acmpeq 26&lt;br/&gt;
   14: aload_0&lt;br/&gt;
   15: invokestatic #50; //Method clojure/core$next.invokeStatic:(Ljava/lang/Object;)Ljava/lang/Object;&lt;br/&gt;
   18: astore_0&lt;br/&gt;
   19: goto 0&lt;br/&gt;
   22: goto 30&lt;br/&gt;
   25: pop&lt;br/&gt;
   26: aload_0&lt;br/&gt;
   27: invokestatic #59; //Method clojure/core$first.invokeStatic:(Ljava/lang/Object;)Ljava/lang/Object;&lt;br/&gt;
   30: areturn&lt;br/&gt;
&amp;lt;/pre&amp;gt;&lt;/p&gt;

&lt;p&gt;Line number 22 is an unreachable goto given the prior goto on line 19.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-274] cannot close over mutable fields (in deftype)</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-274</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Simplest case:&lt;/p&gt;

&lt;p&gt;user=&amp;gt;&lt;br/&gt;
(deftype Bench &lt;span class=&quot;error&quot;&gt;&amp;#91;#^{:unsynchronized-mutable true} val&amp;#93;&lt;/span&gt;&lt;br/&gt;
  Runnable&lt;br/&gt;
  (run &lt;span class=&quot;error&quot;&gt;&amp;#91;_&amp;#93;&lt;/span&gt;&lt;br/&gt;
    (fn [] (set! val 5))))&lt;/p&gt;

&lt;p&gt;java.lang.IllegalArgumentException: Cannot assign to non-mutable: val (NO_SOURCE_FILE:5)&lt;/p&gt;

&lt;p&gt;Functions should be able to mutate mutable fields in their surrounding deftype (just like inner classes do in Java).&lt;/p&gt;

&lt;p&gt;Filed as bug, because the loop special form expands into a fn form sometimes:&lt;/p&gt;

&lt;p&gt;user=&amp;gt;&lt;br/&gt;
(deftype Bench &lt;span class=&quot;error&quot;&gt;&amp;#91;#^{:unsynchronized-mutable true} val&amp;#93;&lt;/span&gt;&lt;br/&gt;
  Runnable&lt;br/&gt;
  (run &lt;span class=&quot;error&quot;&gt;&amp;#91;_&amp;#93;&lt;/span&gt;&lt;br/&gt;
    (let [x (loop [] (set! val 5))])))&lt;br/&gt;
java.lang.IllegalArgumentException: Cannot assign to non-mutable: val (NO_SOURCE_FILE:9)&lt;/p&gt;</description>
                <environment></environment>
            <key id="13671">CLJ-274</key>
            <summary>cannot close over mutable fields (in deftype)</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                        <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="-1">None</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Feb 2010 16:41:00 -0600</created>
                <updated>Fri, 1 Oct 2010 09:35:00 -0500</updated>
                                                    <fixVersion>Backlog</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="23526" author="importer" created="Fri, 1 Oct 2010 09:35:00 -0500"  >&lt;p&gt;Converted from &lt;a href=&quot;http://www.assembla.com/spaces/clojure/tickets/274&quot;&gt;http://www.assembla.com/spaces/clojure/tickets/274&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="23527" author="importer" created="Fri, 1 Oct 2010 09:35:00 -0500"  >&lt;p&gt;donmullen said: Updated each run to &lt;span class=&quot;error&quot;&gt;&amp;#91;_&amp;#93;&lt;/span&gt; for new syntax.&lt;/p&gt;

&lt;p&gt;Now gives exception listed.&lt;/p&gt;</comment>
                    <comment id="23528" author="importer" created="Fri, 1 Oct 2010 09:35:00 -0500"  >&lt;p&gt;richhickey said: We&apos;re not going to allow closing over mutable fields. Instead we&apos;ll have to generate something other than fn for loops et al used as expressions. Not going to come before cinc&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>