<!-- 
RSS generated by JIRA (4.4#649-r158309) at Fri May 24 18:42:57 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CLJ-184/CLJ-184.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-184] n-ary bit functions, also inlining of n-ary bit and math operations</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-184</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Add an &amp;amp;more version to the bit operations bit-and bit-or bit-xor bit-and-not (via reduce),&lt;br/&gt;
Inline the n-ary version of the math ops, + - * /, inline the n-ary versions of bit-and bit-or bit-xor bit-and-not&lt;/p&gt;</description>
                <environment></environment>
            <key id="13581">CLJ-184</key>
            <summary>n-ary bit functions, also inlining of n-ary bit and math operations</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="alan@thinkrelevance.com">Alan Dipert</assignee>
                                <reporter username="importer">Assembla Importer</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Aug 2009 17:37:00 -0500</created>
                <updated>Fri, 1 Mar 2013 12:47:03 -0600</updated>
                    <resolved>Sat, 14 May 2011 16:21:04 -0500</resolved>
                                            <fixVersion>Release 1.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="23159" author="importer" created="Tue, 24 Aug 2010 06:19:00 -0500"  >&lt;p&gt;Converted from &lt;a href=&quot;http://www.assembla.com/spaces/clojure/tickets/184&quot;&gt;http://www.assembla.com/spaces/clojure/tickets/184&lt;/a&gt;&lt;br/&gt;
Attachments:&lt;br/&gt;
inlinemath.patch - &lt;a href=&quot;https://www.assembla.com/spaces/clojure/documents/dlFRFQKPyr3RaoeJe5aVNr/download/dlFRFQKPyr3RaoeJe5aVNr&quot;&gt;https://www.assembla.com/spaces/clojure/documents/dlFRFQKPyr3RaoeJe5aVNr/download/dlFRFQKPyr3RaoeJe5aVNr&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="23160" author="importer" created="Tue, 24 Aug 2010 06:19:00 -0500"  >&lt;p&gt;Jonathan A Smith said: [&lt;a href=&quot;file:dlFRFQKPyr3RaoeJe5aVNr&quot;&gt;file:dlFRFQKPyr3RaoeJe5aVNr&lt;/a&gt;]: inline math and bit-or patch file&lt;/p&gt;</comment>
                    <comment id="23161" author="importer" created="Tue, 24 Aug 2010 06:19:00 -0500"  >&lt;p&gt;Jonathan A Smith said: original math defs stay, new ones get re-defined after proxy is available.&lt;/p&gt;</comment>
                    <comment id="23162" author="importer" created="Tue, 24 Aug 2010 06:19:00 -0500"  >&lt;p&gt;mikehinchey said: Applies clean (though has extra whitespace and tabs).  Existing tests still pass.&lt;/p&gt;</comment>
                    <comment id="23163" author="importer" created="Tue, 24 Aug 2010 06:19:00 -0500"  >&lt;p&gt;Jonathan A Smith said: The defn functions are within a let, which means that they get tabbed in by Emacs ctrl+alt+Q. Is this the referred to &apos;extra whitespace and tabs&apos;?&lt;/p&gt;

&lt;p&gt;I think that this line: &lt;br/&gt;
&amp;gt;0-arities (rule-set (fn &lt;span class=&quot;error&quot;&gt;&amp;#91;x&amp;#93;&lt;/span&gt; (&amp;gt; x 1)))&lt;/p&gt;

&lt;p&gt;might be a mistake, and perhaps should be:&lt;br/&gt;
&amp;gt;0-arities (rule-set (fn &lt;span class=&quot;error&quot;&gt;&amp;#91;x&amp;#93;&lt;/span&gt; (&amp;gt; x 0)))&lt;/p&gt;

&lt;p&gt;But I will have to look at it and rebuild it when I get home tonight. resulting tests would still pass as the only effected function would be the single arity subtraction operation.&lt;/p&gt;</comment>
                    <comment id="23164" author="importer" created="Tue, 24 Aug 2010 06:19:00 -0500"  >&lt;p&gt;mikehinchey said: &quot;git am&quot; complained about whitespace at the ends of lines.  When I tab on each line to re-indent, emacs replaced tabs with spaces and deleted space at the end.  Also, you could combine the 2 let blocks into 1.&lt;/p&gt;</comment>
                    <comment id="23165" author="importer" created="Tue, 24 Aug 2010 06:19:00 -0500"  >&lt;p&gt;richhickey said: This still needs work. I&apos;d like to avoid the need for proxy. It would be easy to make Compiler.isInline() in the compiler presume :inline-arities is an IFn (so sets literals would still work, but so would predicate fns)&lt;/p&gt;</comment>
                    <comment id="23166" author="importer" created="Tue, 24 Aug 2010 06:19:00 -0500"  >&lt;p&gt;richhickey said: I&apos;ve made that change, so isInline now treats :inline-arities as a predicate IFn. This should allow for a simpler implementation&lt;/p&gt;</comment>
                    <comment id="26385" author="redinger" created="Fri, 22 Apr 2011 11:40:46 -0500"  >&lt;p&gt;Adding patch from Assembla&lt;/p&gt;</comment>
                    <comment id="26415" author="alan@thinkrelevance.com" created="Sat, 30 Apr 2011 15:59:33 -0500"  >&lt;p&gt;inlining and n-ary bit functions and math ops&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;n-ary versions and inlines of bit-and, bit-or, bit-xor, bit-and-not&lt;/li&gt;
	&lt;li&gt;n-ary inlines for +, +&apos;, *, *&apos;, /, -, -&apos;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This patch doesn&apos;t optimize / such that the &amp;amp; more version expands to equivalent of (/ x (reduce * y more)) rather than (reduce / (/ x y) more).  The original patch had a divide-by-zero bug, and I think adding this should be another ticket.&lt;/p&gt;</comment>
                    <comment id="26416" author="alan@thinkrelevance.com" created="Sat, 30 Apr 2011 16:12:34 -0500"  >&lt;p&gt;Created &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-785&quot; title=&quot;Optimize /&quot;&gt;&lt;del&gt;CLJ-785&lt;/del&gt;&lt;/a&gt; for optimizing n-ary /&lt;/p&gt;</comment>
                    <comment id="26417" author="ataggart" created="Tue, 3 May 2011 13:46:16 -0500"  >&lt;p&gt;You&apos;d have less copypasta using this:&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 ^:private binary-inline
  ([op]
    (fn
      ([x y] `(. clojure.lang.Numbers (~op ~x ~y)))
      ([x y &amp;amp; more]
        (reduce1
          (fn [a b] `(. clojure.lang.Numbers (~op ~a ~b)))
          `(. clojure.lang.Numbers (~op ~x ~y)) more))))
  ([op unchecked-op]
    (if *unchecked-math*
      (binary-inline unchecked-op)
      (binary-inline op))))

(defn ^:private &amp;gt;1? [n] (clojure.lang.Numbers/gt n 1))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Also, &lt;tt&gt;^:static&lt;/tt&gt; doesn&apos;t do anything anymore.&lt;/p&gt;

&lt;p&gt;The above was from &lt;a href=&quot;https://github.com/ataggart/clojure/commits/n-ary&quot;&gt;the branch I made&lt;/a&gt;, that I mentioned in &lt;a href=&quot;http://groups.google.com/group/clojure-dev/msg/a9d7d36f3c4f96bb&quot;&gt;the thread on ticket status&lt;/a&gt;.  It also included a fix for the inefficient divide.  &lt;/p&gt;</comment>
                    <comment id="26418" author="alan@thinkrelevance.com" created="Tue, 3 May 2011 20:50:37 -0500"  >&lt;p&gt;Thanks, I&apos;ll extract a patch for this from your branch.&lt;/p&gt;</comment>
                    <comment id="26422" author="alan@thinkrelevance.com" created="Fri, 6 May 2011 12:39:20 -0500"  >&lt;p&gt;This patch incorporates Alex Taggart&apos;s work in the comments, but leaves out the change to &lt;tt&gt;/&lt;/tt&gt;.  It made a call to the nonexistent Numbers/unchecked_divide method and multiplies in the denominator, which is faster but has different overflow behavior than divide/reduce.&lt;/p&gt;</comment>
                    <comment id="26423" author="ataggart" created="Sat, 7 May 2011 00:30:17 -0500"  >&lt;p&gt;One problem with the patch: while the bit-ops fns have n-ary support for their inlines, the fns themselves do not.  They need to be updated to 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 bit-and
  &quot;Bitwise and&quot;
  {:inline (nary-inline &apos;and)
   :inline-arities &amp;gt;1?
   :added &quot;1.0&quot;}
  ([x y] (. clojure.lang.Numbers and x y))
  ([x y &amp;amp; more]
    (reduce1 bit-and (bit-and x y) more)))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="26424" author="alan@thinkrelevance.com" created="Mon, 9 May 2011 23:42:31 -0500"  >&lt;p&gt;Attached 184-inlining-nary-math-3.diff. Same as previous patch, but adds n-ary version of bit fns in addition to inlines, which were missing as Alex Taggart pointed out.  Thanks for catching that!&lt;/p&gt;</comment>
                    <comment id="26440" author="alan@thinkrelevance.com" created="Sat, 14 May 2011 16:21:05 -0500"  >&lt;p&gt;Patch is in 1.3-alpha7&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10218" name="184-inlining-nary-math-2.diff" size="4878" author="alan@thinkrelevance.com" created="Fri, 6 May 2011 12:39:20 -0500" />
                    <attachment id="10220" name="184-inlining-nary-math-3.diff" size="5329" author="alan@thinkrelevance.com" created="Mon, 9 May 2011 23:42:30 -0500" />
                    <attachment id="10214" name="184-inlining-nary-math.diff" size="5884" author="alan@thinkrelevance.com" created="Sat, 30 Apr 2011 15:59:33 -0500" />
                    <attachment id="10196" name="inlinemath.patch" size="4322" author="redinger" created="Fri, 22 Apr 2011 11:40:46 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10007">Ok</customfieldvalue>

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