<!-- 
RSS generated by JIRA (4.4#649-r158309) at Thu May 23 15:44:16 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-1033/CLJ-1033.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-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>
</channel>
</rss>