Details
-
Type:
Enhancement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: Release 1.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:
-
Environment:Ubuntu 12.04 LTS; Java 1.7.0_05 Java HotSpot(TM) Client VM
-
Approval:Vetted
Description
user=> (read-string (pr-str {(keyword "key@other") :stuff}))
RuntimeException Map literal must contain an even number of forms clojure.lang.Util.runtimeException (Util.java:170)
pr-str emits "{:key@other :stuff}", 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.
Background: I'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've fallen back to JSON serialization.
The '@' character is not a legal character for keywords or symbols (see http://clojure.org/reader). Recategorized as enhancement request.