<!--
RSS generated by JIRA (4.4#649-r158309) at Thu May 23 21:20:44 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/temp/SearchRequest.xml?jqlQuery=project+%3D+10010+AND+labels+%3D+Compiler&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>Clojure JIRA</title>
        <link>http://dev.clojure.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+10010+AND+labels+%3D+Compiler</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="6" total="6"/>
                <build-info>
            <version>4.4</version>
            <build-number>649</build-number>
            <build-date>25-07-2011</build-date>
        </build-info>
<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>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>
                                <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-1136] Type hinting for array classes does not work in binding forms</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1136</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Type hints don&apos;t work as expected in binding forms. &lt;/p&gt;

&lt;p&gt;The following form results in a reflection warning:&lt;/p&gt;

&lt;p&gt;    (let [^{:tag (Class/forName &quot;&lt;span class=&quot;error&quot;&gt;&amp;#91;Ljava.lang.Object;&amp;quot;)} a (make-array Object 2)&amp;#93;&lt;/span&gt;&lt;br/&gt;
      (aget a 0))&lt;/p&gt;

&lt;p&gt;However, hinting does appear to work correctly on vars:&lt;/p&gt;

&lt;p&gt;    (def ^{:tag (Class/forName &quot;[Ljava.lang.Object;&quot;)} a (make-array Object 2))&lt;br/&gt;
    (aget a 0) ;; no reflection warning&lt;/p&gt;</description>
                <environment>replicated on OpenJDK 7u9 on Ubuntu 12.04, and Hotspot 1.6.0_37 on OSX Lion</environment>
            <key id="15911">CLJ-1136</key>
            <summary>Type hinting for array classes does not work in binding forms</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="lvanderhart">Luke VanderHart</reporter>
                        <labels>
                        <label>Compiler</label>
                        <label>bug</label>
                    </labels>
                <created>Thu, 20 Dec 2012 14:59:58 -0600</created>
                <updated>Fri, 21 Dec 2012 11:09:56 -0600</updated>
                                    <version>Release 1.4</version>
                <version>Release 1.5</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="30272" author="gshayban" created="Thu, 20 Dec 2012 22:51:22 -0600"  >&lt;p&gt;It&apos;s a little more insidious than type hinting: the compiler doesn&apos;t evaluate metadata in the binding vec.&lt;/p&gt;

&lt;p&gt;This doesn&apos;t throw the necessary exception...&lt;/p&gt;

&lt;p&gt;(let &lt;span class=&quot;error&quot;&gt;&amp;#91;^{:foo (Class/forName &amp;quot;not real&amp;quot;)} bar 42&amp;#93;&lt;/span&gt;&lt;br/&gt;
  bar)&lt;/p&gt;

&lt;p&gt;neither this...&lt;/p&gt;

&lt;p&gt;(let &lt;span class=&quot;error&quot;&gt;&amp;#91;^{gyorgy ligeti} a 42&amp;#93;&lt;/span&gt;&lt;br/&gt;
  a)&lt;/p&gt;

&lt;p&gt;Gyorgy Ligeti never resolves.&lt;/p&gt;

&lt;p&gt;These two equivalent examples don&apos;t reflect: &lt;br/&gt;
(let &lt;span class=&quot;error&quot;&gt;&amp;#91;^objects a (make-array Object 2)&amp;#93;&lt;/span&gt;&lt;br/&gt;
  (aget a 0))&lt;/p&gt;

&lt;p&gt;(let &lt;span class=&quot;error&quot;&gt;&amp;#91;a ^objects (make-array Object 2)&amp;#93;&lt;/span&gt;&lt;br/&gt;
  (aget a 0))&lt;/p&gt;
</comment>
                    <comment id="30275" author="gshayban" created="Fri, 21 Dec 2012 11:09:56 -0600"  >&lt;p&gt;On only the left-hand side of a local binding, metadata on a symbol is not analyzed or evaluated.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-1028] (compile) crashes with NullPointerException if public function &apos;load&apos; is defined</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1028</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;When performing AOT compilation, if the namespace being compiled or one of the namespaces :required by it defines a public function named &apos;load&apos;, the compiler will crash with a NullPointerException.&lt;/p&gt;

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

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

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

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

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

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

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

&lt;p&gt;If so, it would be nice if the warning were replaced with an error, rather than having the compiler emit an error and then &lt;b&gt;crash&lt;/b&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11391" name="stack-trace" size="1541" author="toxicfrog" created="Fri, 20 Jul 2012 12:40:30 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[CLJ-918] Vars with {:macro true} meta data do not work when loaded from AOT compiled file</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-918</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;When defining a var with &lt;tt&gt;^{:macro true&lt;/tt&gt;} the call of the binded macro does emit a warning when the definition has been AOT compiled.&lt;/p&gt;

&lt;p&gt;See example outputs with demo code here: &lt;a href=&quot;https://refheap.com/paste/389&quot;&gt;https://refheap.com/paste/389&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bronsa on #clojure created a patch: &lt;a href=&quot;http://sprunge.us/bWcc&quot;&gt;http://sprunge.us/bWcc&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Tested with 1.3.0 and 1.4.0</environment>
            <key id="15145">CLJ-918</key>
            <summary>Vars with {:macro true} meta data do not work when loaded from AOT compiled file</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="5" iconUrl="http://dev.clojure.org/jira/images/icons/priority_trivial.gif">Trivial</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="3">Duplicate</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="jannschu">Jannik Schorg</reporter>
                        <labels>
                        <label>Compiler</label>
                        <label>enhancement</label>
                        <label>metadata</label>
                    </labels>
                <created>Mon, 23 Jan 2012 16:06:06 -0600</created>
                <updated>Thu, 13 Sep 2012 14:29:01 -0500</updated>
                    <resolved>Thu, 13 Sep 2012 14:29:01 -0500</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="29437" author="jafingerhut" created="Thu, 13 Sep 2012 14:29:01 -0500"  >&lt;p&gt;Duplicate of &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1021&quot; title=&quot;(let [i 5] (defmacro m [v] v) m) interprets m as a function, not a macro&quot;&gt;CLJ-1021&lt;/a&gt;.  Later ticket kept in preference to this one, because it has a patch and this one does not.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10010">New</customfieldvalue>

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

<item>
            <title>[CLJ-874] defrecord factory inaccessibly from within type implementation</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-874</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Discovered this issue working through &lt;a href=&quot;https://github.com/relevance/labrepl&quot;&gt;https://github.com/relevance/labrepl&lt;/a&gt; when trying to use the new factory sytax for records:&lt;/p&gt;

&lt;p&gt;(defprotocol Player&lt;br/&gt;
  (choose &lt;span class=&quot;error&quot;&gt;&amp;#91;p&amp;#93;&lt;/span&gt;)&lt;br/&gt;
  (update-strategy &lt;span class=&quot;error&quot;&gt;&amp;#91;p me you&amp;#93;&lt;/span&gt;))&lt;/p&gt;

&lt;p&gt;(defrecord Mean &lt;span class=&quot;error&quot;&gt;&amp;#91;last-winner&amp;#93;&lt;/span&gt;&lt;br/&gt;
&#160;&#160;Player&lt;br/&gt;
&#160;&#160;(choose &lt;span class=&quot;error&quot;&gt;&amp;#91;_&amp;#93;&lt;/span&gt; (if last-winner last-winner (random-choice)))&lt;br/&gt;
&#160;&#160;(update-strategy &lt;span class=&quot;error&quot;&gt;&amp;#91;_ me you&amp;#93;&lt;/span&gt; (-&amp;gt;Mean (when (iwon? me you) me))))&lt;/p&gt;

&lt;p&gt;Notice that Mean returns a new instance with a different strategy.  However, the factory methods are not defined until after the record has been created thus this results in a syntax error.  To fix this I updated the macro to declare the factory methods before the record is emitted.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="15001">CLJ-874</key>
            <summary>defrecord factory inaccessibly from within type implementation</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="kurtharriger">Kurt Harriger</reporter>
                        <labels>
                        <label>Compiler</label>
                    </labels>
                <created>Fri, 11 Nov 2011 11:31:52 -0600</created>
                <updated>Fri, 2 Dec 2011 09:03:00 -0600</updated>
                    <resolved>Fri, 2 Dec 2011 09:03:00 -0600</resolved>
                            <version>Release 1.4</version>
                                                        <due></due>
                    <votes>4</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="27275" author="kurtharriger" created="Fri, 11 Nov 2011 11:33:20 -0600"  >&lt;p&gt;On github: &lt;a href=&quot;https://github.com/kurtharriger/clojure/tree/fix-defrecord&quot;&gt;https://github.com/kurtharriger/clojure/tree/fix-defrecord&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="27336" author="hiredman" created="Mon, 21 Nov 2011 13:19:41 -0600"  >&lt;p&gt;looks good to me&lt;/p&gt;</comment>
                    <comment id="27348" author="aaron" created="Sat, 26 Nov 2011 11:58:45 -0600"  >&lt;p&gt;Screened against e58a87fac72ed4b84a1d92f1e455b92d7ed3ef39&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10693" name="defrecord-patch.diff" size="927" author="kurtharriger" created="Fri, 11 Nov 2011 11:31:52 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10007">Ok</customfieldvalue>

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

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

<item>
            <title>[CLJ-865] Macroexpansion discards &amp;form metadata</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-865</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;As discussed in &lt;a href=&quot;http://groups.google.com/group/clojure/browse_thread/thread/2690cb6ca0e8beb8&quot;&gt;http://groups.google.com/group/clojure/browse_thread/thread/2690cb6ca0e8beb8&lt;/a&gt; there is a &quot;surprise factor&quot; when type-hinting an expression that represents a macro, such as with (.length ^String (doto (identity &quot;x&quot;) prn)). Here the doto macro discards the metadata on &amp;amp;form, causing a reflective lookup. This has the effect that while expressions representing function calls can be type-hinted, expressions representing macros in general cannot. The doto macro could be rewritten to respect its &amp;amp;form metadata, but doing this for every macro in existence would be tedious and error-prone. Instead, I propose a change to the compiler, to cause macroexpansion to hang onto the metadata automatically.&lt;/p&gt;

&lt;p&gt;The first patch attached adds a test for the behavior I propose: this test fails. After applying the second patch, the test passes.&lt;/p&gt;

&lt;p&gt;There are a couple points that merit further consideration before accepting my patch:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;I&apos;m not sure I actually got the Java code formatted correctly. My editor is not well-configured to get the clojure/core style right automatically.&lt;/li&gt;
	&lt;li&gt;My solution is to take the &amp;amp;form metadata, drop :line/:file keys, and then merge with the returned metadata, with &amp;amp;form taking precedence. I&apos;m not sure whether this is the right approach in all cases, even though it works for :tag metadata.&lt;/li&gt;
	&lt;li&gt;I achieved this with a change to the compiler, which makes it fairly heavy-weight. It should be possible to instead adjust defmacro if changes to the compiler are not desirable. However, I believe this would involve substantially more work and be harder to test (for example, multiple arities complicate things). It seems nicer to treat the macroexpansion as a black box and then make metadata tweaks to the result, rather than modifying their actual defmacro code.&lt;/li&gt;
	&lt;li&gt;If a macro expands to something that is not an IObj, such as an Integer, then my patch silently discards the caller&apos;s metadata. Would it be better to throw an exception?&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="14901">CLJ-865</key>
            <summary>Macroexpansion discards &amp;form metadata</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>
                        <label>Compiler</label>
                    </labels>
                <created>Wed, 26 Oct 2011 15:19:11 -0500</created>
                <updated>Wed, 6 Jun 2012 17:29:38 -0500</updated>
                                                                            <due></due>
                    <votes>7</votes>
                        <watches>5</watches>
                        <comments>
                    <comment id="27176" author="amalloy" created="Fri, 28 Oct 2011 01:12:50 -0500"  >&lt;p&gt;So I went ahead and did the work of making this change in clojure.core/defmacro instead of clojure.lang.Compiler/macroexpand1. It was even worse than I expected: I didn&apos;t realize we don&apos;t yet have syntax-quote or apply at this stage in bootstrapping, so writing a non-trivial macroexpansion requires a huge amount of (list `foo (list `bar &apos;local-name)) and so forth.&lt;/p&gt;

&lt;p&gt;I&apos;m sure the version I wrote is not optimal, but it seemed simpler to piggyback on defn, and then use alter-var-root to shim the metadata management in, than it would have been to expand to the correct thing in the first place.&lt;/p&gt;

&lt;p&gt;Anyway, attached patch #3 could be applied instead of #2 to resolve the issue in clojure.core instead of clojure.lang. The tests added in patch #1 pass either way.&lt;/p&gt;</comment>
                    <comment id="27286" author="amalloy" created="Sun, 13 Nov 2011 20:29:06 -0600"  >&lt;p&gt;I realized I can do this with a named private function instead of an anonymous function, reducing the amount of mess defmacro itself has to generate. Patch 4 is, I think, strictly better than Patch 3, if a Clojure implementation is preferred to one in Java.&lt;/p&gt;</comment>
                    <comment id="27331" author="chouser@n01se.net" created="Sun, 20 Nov 2011 22:43:45 -0600"  >&lt;p&gt;I prefer patch 0002 in Java over either 0003 or 0004. Patch 0002 keeps the knowledge of how to invoke macro fns (specifically the extra &amp;amp;form and &amp;amp;env args) in one place, macroexpand1 rather than duplicating that knowledge in core.clj as well. Note patch 0001 is just tests.&lt;/p&gt;

&lt;p&gt;The proposed default macroexpansion behavior is more useful than what we currently have, but there are two details I&apos;d like to think about a bit more:&lt;/p&gt;

&lt;p&gt;1) In exchange for a more useful default, macro writers lose the ability to consume their &amp;amp;form metadata and have control over the resulting form metadata without the &amp;amp;form metadata overridding it. That is, macros are no longer in complete control of their output form.&lt;/p&gt;

&lt;p&gt;2) Rule (1) above has hardcoded exceptions for :line and :file, where &amp;amp;form metadata is unable to override the results returned by the macro.&lt;/p&gt;</comment>
                    <comment id="28676" author="amalloy" created="Fri, 1 Jun 2012 14:04:02 -0500"  >&lt;p&gt;This patch incorporates all previous patches to this issue.&lt;/p&gt;

&lt;p&gt;On the clj-dev mailing list, Andy Fingerhut suggested a new metadata key for allowing the macro author to specify &quot;I&apos;ve looked at their &amp;amp;form metadata, and this form is exactly what I want to expand to, please don&apos;t change the metadata any further.&quot; I&apos;ve implemented this, and I think it addresses Chouser&apos;s concern about needing a way to &quot;break out&quot; of the improved-default behavior.&lt;/p&gt;

&lt;p&gt;One open question is, is :explicit-meta the right key to use? I spent some time tracking down a bug caused by my forgetting the keyword and using :explicit-metadata in my test; perhaps something more difficult to get confused by is available.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10590" name="0001-Add-test-for-macroexpansion-metadata-preservation.patch" size="1258" author="amalloy" created="Wed, 26 Oct 2011 15:19:11 -0500" />
                    <attachment id="10591" name="0002-Preserve-form-metadata-on-macroexpanded-forms.patch" size="1571" author="amalloy" created="Wed, 26 Oct 2011 15:19:11 -0500" />
                    <attachment id="10592" name="0003-Make-defmacro-preserve-form-metadata.patch" size="3898" author="amalloy" created="Fri, 28 Oct 2011 01:12:50 -0500" />
                    <attachment id="10703" name="0004-Another-stab-at-implementing-this.patch" size="3397" author="amalloy" created="Sun, 13 Nov 2011 20:29:06 -0600" />
                    <attachment id="11281" name="updated.patch" size="3824" author="amalloy" created="Fri, 1 Jun 2012 14:04:02 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <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>
</channel>
</rss>