10 comments

[ 3.1 ms ] story [ 28.8 ms ] thread
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.
I can't see the gain of:

    #uuid "550e8400-e29b-41d4-a716-446655440000"
over:

    (uuid "550e8400-e29b-41d4-a716-446655440000")
The reader already supports it, functions/macro are already namespaced and you still have to parse it anyway.
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 do not understand what do you mean by "carried around as data", a s-expr is data. Could you give me an example where you can't use the first form?
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.

(comment deleted)
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.