2016-08-25 1:53 GMT+02:00 Matching Socks <phill.w...@gmail.com>:

> Namespaced XML is inherently value-comparable and unambiguous.  It would
> be shame to give up on that, and disperse the burden throughout every layer
> of library and consumer.
>

That's a very good point. Disregarding concerns for edn syntax for a
moment, the best solution would seem to standardize on qnames, since those
are the jvm-wide canonical mapping. With reader tags, they are almost there
in terms of read/writability, but not quite as convenient as
::alias/keywords

When designing the namespacing support, I discarded the idea to cram uris
into keywords, because of the impedance mismatch. I thank you for bringing
it up again, though, because I overlooked a very important failure case,
when trying to preserve value semantics:

Say, a library chooses not to use keyword mapping for a given xmlns and
instead matches on qname instances, but then somebody within the system
establishes an alias for that xmlns. Said library will then silently get
keywordized data, that it won't recognize anymore. Unfortunately, I don't
know how to catch that with an explicit error either.

So yes, I am open to experimenting with encoding uris into keywords.

Pretty-printing need not be a concern of the XML parsing library.  Everyone
> seems to be interested nowadays in easing the usage of namespaced
> keywords.  Perhaps printing could be improved (globally) to use the
> caller's keyword namespace aliases.
>

Yes, it doesn't feel right to let an easily adaptable concern like
pretty-printing dictate value semantics.

By all means, use an encoding more legible than Base64.  URLEncoder could
> be an example in the way it uses %.  Pick an escape character that's legal
> in Clojure namespace names, but unusual in the best-known namespace URIs.
> Apostrophe?
>

Yes, or maybe map to unicode lookalikes and escape those, should they ever
occur in a ns-uri.
e.g.

/ -> ⧄
: -> ╎

Though, those are not alphanumeric characters, so probably illegal in
keywords.

Any thoughts so far?

-- 
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