<!-- 
RSS generated by JIRA (4.4#649-r158309) at Tue May 21 02:14:39 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/MATCH-32/MATCH-32.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>[MATCH-32] Allow flattened pattern syntax at top-level to avoid nesting :when and :as</title>
                <link>http://dev.clojure.org/jira/browse/MATCH-32</link>
                <project id="10050" key="MATCH">core.match</project>
                        <description>&lt;p&gt;On the Clojure mailing list I wrote:&lt;/p&gt;

&lt;p&gt;For guards, I wonder if the extra parens are really necessary.  Couldn&apos;t the :when bind tightly to the previous pattern variable?  Like Clojure FOR comprehensions.  I think it would be easier to read that way.  Same comment applies to :as.  To cover the rare case of matching a literal :when or :as, you could quote it or use it as the first item in an OR pattern.&lt;/p&gt;

&lt;p&gt;On Oct 10, 2011, at 3:11 PM, David Nolen wrote:&lt;/p&gt;

&lt;p&gt;It would be nice to lose the extra parens - patch welcome &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;</description>
                <environment></environment>
            <key id="14694">MATCH-32</key>
            <summary>Allow flattened pattern syntax at top-level to avoid nesting :when and :as</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="5" iconUrl="http://dev.clojure.org/jira/images/icons/status_resolved.gif">Resolved</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="steveminer@gmail.com">Steve Miner</reporter>
                        <labels>
                    </labels>
                <created>Wed, 12 Oct 2011 10:28:44 -0500</created>
                <updated>Fri, 21 Oct 2011 18:53:52 -0500</updated>
                    <resolved>Fri, 21 Oct 2011 18:53:51 -0500</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="26943" author="steveminer@gmail.com" created="Wed, 12 Oct 2011 10:35:56 -0500"  >&lt;p&gt;I attached a patch that groups the :when and :as terms appropriately given a &quot;flattened&quot; syntax.  That is, &lt;span class=&quot;error&quot;&gt;&amp;#91;a :when even?&amp;#93;&lt;/span&gt; becomes &lt;span class=&quot;error&quot;&gt;&amp;#91;(a :when even?)&amp;#93;&lt;/span&gt; before being processed as usual.  I only applied it to the top-level of the pattern row because I was concerned about recursive performance and things can get pretty complicated so maybe the magic isn&apos;t worth it.&lt;/p&gt;

&lt;p&gt;Only :when and :as at the top level get any special treatment.  No mangling for :seq or ::vector, etc.  No mangling of nested patterns.&lt;/p&gt;

&lt;p&gt;I also added a couple of tests for my changes.&lt;/p&gt;</comment>
                    <comment id="26977" author="steveminer@gmail.com" created="Fri, 14 Oct 2011 13:03:44 -0500"  >&lt;p&gt;I wrote an improved patch that should handle nested patterns as well.  Still only groups :when and :as, not :seq since that seems sort of special.&lt;/p&gt;</comment>
                    <comment id="26982" author="steveminer@gmail.com" created="Sat, 15 Oct 2011 07:59:41 -0500"  >&lt;p&gt;Better to use seq? instead of list?&lt;/p&gt;</comment>
                    <comment id="26985" author="dnolen" created="Sat, 15 Oct 2011 10:24:32 -0500"  >&lt;p&gt;At first glance this looks pretty neat! Will try to take a deeper look today. Thanks!&lt;/p&gt;</comment>
                    <comment id="26987" author="dnolen" created="Sat, 15 Oct 2011 10:47:15 -0500"  >&lt;p&gt;One issue I have with this syntax enhancement - how does one match :when or :as as literals?&lt;/p&gt;</comment>
                    <comment id="26991" author="steveminer@gmail.com" created="Sat, 15 Oct 2011 15:13:34 -0500"  >&lt;p&gt;The patch tries to group the :when or :as if that makes sense.  If it doesn&apos;t make sense &lt;span class=&quot;error&quot;&gt;&amp;#91;:when true nil&amp;#93;&lt;/span&gt;, it leaves it alone so that would match the literal.  In the rare case where it would be ambiguous, you would have to use a single OR pattern to get a literal match, such as &lt;span class=&quot;error&quot;&gt;&amp;#91;a (:when |) false&amp;#93;&lt;/span&gt;.  I put something like that in one of my new tests.&lt;/p&gt;</comment>
                    <comment id="26992" author="steveminer@gmail.com" created="Sat, 15 Oct 2011 15:18:29 -0500"  >&lt;p&gt;By the way, it might be nice to allow a single element list to match that single pattern.  That is, treat &lt;span class=&quot;error&quot;&gt;&amp;#91;(p)&amp;#93;&lt;/span&gt; the same as &lt;span class=&quot;error&quot;&gt;&amp;#91;p&amp;#93;&lt;/span&gt;.  Right now, it&apos;s considered an error.  It would also simply my patch, where I had to introduce interpose1 (as a variant of interpose) to handle an edge case with the OR pattern.&lt;/p&gt;</comment>
                    <comment id="27075" author="dnolen" created="Thu, 20 Oct 2011 13:54:50 -0500"  >&lt;p&gt;I&apos;m not a fan of (:when |). I&apos;d prefer it if the patch included support for always matching literal keywords that are written as &apos;:foo.&lt;/p&gt;</comment>
                    <comment id="27076" author="steveminer@gmail.com" created="Thu, 20 Oct 2011 15:04:32 -0500"  >&lt;p&gt;Revised patch to support &apos;:when (and quoted keywords in general) to match the literal keyword.  Updated against HEAD.&lt;/p&gt;</comment>
                    <comment id="27081" author="dnolen" created="Fri, 21 Oct 2011 18:53:52 -0500"  >&lt;p&gt;Fixed, &lt;a href=&quot;https://github.com/clojure/core.match/commit/d69abfaf68a86d5b9d73070e666720770779118f&quot;&gt;https://github.com/clojure/core.match/commit/d69abfaf68a86d5b9d73070e666720770779118f&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10394" name="flat2.patch" size="5058" author="steveminer@gmail.com" created="Fri, 14 Oct 2011 13:03:44 -0500" />
                    <attachment id="10396" name="flat3.patch" size="6113" author="steveminer@gmail.com" created="Sat, 15 Oct 2011 07:59:41 -0500" />
                    <attachment id="10492" name="flat4.patch" size="5694" author="steveminer@gmail.com" created="Thu, 20 Oct 2011 15:04:32 -0500" />
                    <attachment id="10381" name="flat.patch" size="4258" author="steveminer@gmail.com" created="Wed, 12 Oct 2011 10:28:45 -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>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10012">Accepted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>
</channel>
</rss>