The Extensible Reader is really the next step in terms of a common extensible data exchange format. Atm everybody builds this himself for his application, this commes with alot of wheel reinvention. Make it extensible is the first step to find out whats most used. People can find each other and creat common abstractions.
Something like `(uuid "550e8400-e29b-41d4-a716-446655440000")` can't be carried around as data whereas `#uuid "550e8400-e29b-41d4-a716-446655440000"` can be.
Think about data interchange between Clojure & ClojureScript.
I think the issue is that in order to use the first form, you would need to eval the s-expr after reading it, which is potentially dangerous and fragile. But also, ClojureScript doesn't have run-time eval. Of course, you could interpret the s-expr as some kind of tagged list (or more likely use a vector like [:uuid "550..."]) and instead of eval-ing check the first element etc, but at that point, why not have an extensible reader do that for you?
Of course `(uuid "…")` can be carried around as data; it's a list containing a symbol and a string, just like `#uuid "…"` is a tag and a string. The difference is that the latter is evaluated at read-time with constrained semantics, rather than requiring the full force and latitude of `eval`.
i.e. definitely helpful for data interchange between Clojure implementations (and read-time shenanigans in general), and a big improvement over the depths of #= and such.
Well sure you can just pass around clojure code and eval it but the point is to have it in the reader. Other languages can interface to that read. (uuid ....) does not work when you dont have a clojure evaluater on the reciver.
10 comments
[ 3.1 ms ] story [ 28.8 ms ] threadA much more complex example reading a UTC instant in time like `#inst "2010-11-12T13:14:15.666-06:00"` is found at https://github.com/clojure/clojure/blob/master/src/clj/cloju...
Think about data interchange between Clojure & ClojureScript.
i.e. definitely helpful for data interchange between Clojure implementations (and read-time shenanigans in general), and a big improvement over the depths of #= and such.