Reading "%" with the ClojureScript reader

Showing 1-4 of 4 messages
Reading "%" with the ClojureScript reader Jonas Enlund 7/22/13 9:20 AM

According to the edn spec[1] '%' is a valid symbol and it's currently being used in datomics datalog to refer to rules. The ClojureScript reader is not able to read "%" as a symbol as shown by the following repl session:

cljs.user> (ns cljs.user (:require [cljs.reader :refer [read-string]]))
cljs.user> (read-string "%")
org.mozilla.javascript.JavaScriptException: Error: Reader for % not implemented yet

The reason for the error is at[2] where '%' is explicitly called out to throw the above error (probably to leave room for future extensions?).

Given the edn spec and the fact that the symbol can be read with the Clojure reader (and the new Clojure edn reader), should we lift this restriction and allow "%" to be read by the ClojureScript reader?

If all agree I can open an issue+patch on JIRA where I remove the line at [2].


Re: Reading "%" with the ClojureScript reader David Nolen 7/23/13 9:06 AM
Ticket + patch welcome, thanks!

You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

Re: Reading "%" with the ClojureScript reader gfredericks 7/23/13 1:29 PM
Was the point of the error to be able to read forms like "#(%5)" correctly? E.g., on clj-jvm we have

(read-string "#(%5)") => (fn* [p1__3878# p2__3879# p3__3880# p4__3881# p5__3877#] (p5__3877#))

Would cljs have the same behavior if the error were removed? should it?
Gary Fredericks
Re: Reading "%" with the ClojureScript reader Jonas Enlund 7/23/13 1:51 PM
The clojurescript reader does not implement the #(...) reader macro.