Have you tried this with Transit instead of EDN? From what I understand by
all this Transit shouldn't have problems with spaces in keywords/strings as
it doesn't print them in the same way, it's more of a marshaling format
than a printer/reader, and you get the big upside of Transit being *way*
faster than EDN.

Aside from that, I'd recommend just introducing a new type. It's easy to
extend EDN, as you've mentioned, so why not just have a new type called
IonSymbol that you use when talking to ION. Use defrecord, and you'll get
equality semantics out of the box.

On Thu, Aug 9, 2018 at 10:27 PM Didier <didi...@gmail.com> wrote:

> Ion is a data serialization format from Amazon
> http://amzn.github.io/ion-docs/
>
> One lf its supported data type is symbol, defined as: Interned, Unicode
> symbolic atoms (aka identifiers)
>
> I interact with systems that interchange their data using ION. My systems
> use EDN though internally. Thus I need to convert from ION to EDN and back
> in a lossless manner.
>
> If you give me ION with symbols in them, and I convert them to EDN, I need
> be able to go back to the exact same ION symbol when converting my EDN back
> to ION.
>
> If I make symbols string, I lose the type info, and would convert it back
> to an ION string. This wouod break my clients.
>
> I thought I could get away not having to build a custom representation for
> them in Clojure and EDN, and piggyback on keywords.
>
> It now seems to me like I can still piggyback on keywords when in Clojure,
> since `keyword` and clojure.lang.Keyword appear to support full unicode.
>
> But it seems EDN does not support full unicode serialization for them. So
> I've extended the edn serialization and deserialization so that it does.
>
> I did so by overriding print-method for keywords so that when it prints in
> an unreadable way, it instead outputs a custom literal #myproject/keyword
> "namespace/name". And I've added a reader for this which uses keyword to
> get a Clojure keyword back.
>
> Does any of this seem unsound to anyone?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to