<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sat May 18 22:22:58 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-783/CLJ-783.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-783] clojure.inspector/inspect-tree doesn&apos;t work on sets --patch in the description by Jason Wolfe</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-783</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;As reported by Jason Wolfe on March 19, 2009 in the clojure group:&lt;/p&gt;

&lt;p&gt;clojure.inspector/inspect-tree doesn&apos;t work on sets; patch attached&lt;br/&gt;
&lt;a href=&quot;http://groups.google.com/group/clojure/browse_thread/thread/97bcad115fcfaf5a/95e61c423c61cfa8?lnk=gst&amp;amp;q=inspector+set#95e61c423c61cfa8&quot;&gt;http://groups.google.com/group/clojure/browse_thread/thread/97bcad115fcfaf5a/95e61c423c61cfa8?lnk=gst&amp;amp;q=inspector+set#95e61c423c61cfa8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was debugging with inspect-tree and noticed that it errors when it &lt;br/&gt;
encounters a set (it thinks it&apos;s not atomic, but then nth produces an &lt;br/&gt;
UnsupportedOperationException). &lt;/p&gt;

&lt;p&gt;I made a small patch (below) that makes inspect-tree work on &lt;br/&gt;
java.util.Sets, and also anything else that implements &lt;br/&gt;
clojure.lang.Seqable.  If this is of interest, please let me know and &lt;br/&gt;
I can create an issue. &lt;/p&gt;


&lt;p&gt;Cheers, &lt;br/&gt;
Jason &lt;/p&gt;


&lt;p&gt;Index: src/clj/clojure/inspector.clj &lt;br/&gt;
=================================================================== &lt;br/&gt;
&amp;#8212; src/clj/clojure/inspector.clj       (revision 1335) &lt;br/&gt;
+++ src/clj/clojure/inspector.clj       (working copy) &lt;br/&gt;
@@ -20,8 +20,10 @@ &lt;br/&gt;
 (defn collection-tag &lt;span class=&quot;error&quot;&gt;&amp;#91;x&amp;#93;&lt;/span&gt; &lt;br/&gt;
   (cond &lt;br/&gt;
    (instance? java.util.Map$Entry x) :entry &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;(instance? java.util.Map x) :map&lt;br/&gt;
+   (instance? java.util.Map x) :seqable &lt;br/&gt;
+   (instance? java.util.Set x) :seqable &lt;br/&gt;
    (sequential? x) :seq &lt;br/&gt;
+   (instance? clojure.lang.Seqable x) :seqable &lt;br/&gt;
    :else :atom)) &lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt; (defmulti is-leaf collection-tag) &lt;br/&gt;
@@ -42,11 +44,15 @@ &lt;br/&gt;
 (defmethod get-child-count :entry &lt;span class=&quot;error&quot;&gt;&amp;#91;e&amp;#93;&lt;/span&gt; &lt;br/&gt;
   (count (val e))) &lt;/p&gt;


&lt;p&gt;-(defmethod is-leaf :map &lt;span class=&quot;error&quot;&gt;&amp;#91;m&amp;#93;&lt;/span&gt; &lt;br/&gt;
+(defmethod is-leaf :seqable &lt;span class=&quot;error&quot;&gt;&amp;#91;parent&amp;#93;&lt;/span&gt; &lt;br/&gt;
   false) &lt;br/&gt;
-(defmethod get-child :map &lt;span class=&quot;error&quot;&gt;&amp;#91;m index&amp;#93;&lt;/span&gt; &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;(nth (seq m) index))&lt;br/&gt;
+(defmethod get-child :seqable &lt;span class=&quot;error&quot;&gt;&amp;#91;parent index&amp;#93;&lt;/span&gt; &lt;br/&gt;
+  (nth (seq parent) index)) &lt;br/&gt;
+(defmethod get-child-count :seqable &lt;span class=&quot;error&quot;&gt;&amp;#91;parent&amp;#93;&lt;/span&gt; &lt;br/&gt;
+  (count (seq parent))) &lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt; (defn tree-model &lt;span class=&quot;error&quot;&gt;&amp;#91;data&amp;#93;&lt;/span&gt; &lt;br/&gt;
   (proxy &lt;span class=&quot;error&quot;&gt;&amp;#91;TreeModel&amp;#93;&lt;/span&gt; [] &lt;br/&gt;
     (getRoot [] data) &lt;/p&gt;</description>
                <environment>Any</environment>
            <key id="14409">CLJ-783</key>
            <summary>clojure.inspector/inspect-tree doesn&apos;t work on sets --patch in the description by Jason Wolfe</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="ablancas">Armando Blancas</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Apr 2011 11:29:27 -0500</created>
                <updated>Fri, 12 Apr 2013 10:04:52 -0500</updated>
                                                    <fixVersion>Release 1.6</fixVersion>
                                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="27718" author="jafingerhut" created="Tue, 14 Feb 2012 12:54:05 -0600"  >&lt;p&gt;Created a properly formatted patch, attached, for Jason&apos;s enhancement.  I tested it with&lt;/p&gt;

&lt;p&gt;(inspect-tree (:members (clojure.reflect/reflect java.lang.Math)))&lt;/p&gt;

&lt;p&gt;and it worked, whereas it had many errors without Jason&apos;s changes.&lt;/p&gt;</comment>
                    <comment id="27831" author="jafingerhut" created="Thu, 23 Feb 2012 23:58:31 -0600"  >&lt;p&gt;Jason Wolfe has signed a CA.  Patch applies cleanly with latest master as of Feb 14, 2012.  No errors, warnings, or test failures with the patch applied.  No doc strings need updating.&lt;/p&gt;</comment>
                    <comment id="29929" author="stuart.sierra" created="Fri, 9 Nov 2012 16:12:45 -0600"  >&lt;p&gt;Screened.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10909" name="clj-783-patch.txt" size="1294" author="jafingerhut" created="Tue, 14 Feb 2012 12:54:05 -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>
                                                                                    <customfield id="customfield_10003" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                <customfieldname>Waiting On</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>richhickey</customfieldvalue>
                </customfieldvalues>
            </customfield>
                            </customfields>
    </item>
</channel>
</rss>