On Aug 25, 11:28 am, B Smith-Mannschott <bsmith.o...@gmail.com> wrote:
> On Tue, Aug 25, 2009 at 16:24, Licenser<heinz.g...@gmail.com> wrote:
>
> > Hi everyone,
> > I wonder what is the reason clojure uses XML standard wise and not
> > JSON. In the past I've found that JSON is much cleaner to read, and
> > much easier to represent data structures in. I know XML is a buzzword,
> > but JSON is on it's way to become one too. And yes I know Java uses
> > XML extensively, in my eyes too extensively in many parts, but isn't
> > one goal of Clojure not to repeat Javas mistakes?
>
> Alas, XML has long past the point of being merely a buzzword. Some
> ability to consume and produce XML is a necessity for interoperability
> in many domains. Also beyond data-exchange XML also supports document
> authoring applications and mixed content, where solutions like JSON
> aren't so great. (In fairness, XML's not so great either. I'd rather
> use ResturctedText).
>
I like JSON for pulling data out of web apis, combined with the parser
it becomes very convenient.
> JSON has turned out well, for what it does. If there isn't already a
> JSON parser in clojure-contrib, perhaps you'd like to contribute one?
> I'm sure it would find takers.
>
There is one in contrib, I've used it a bit and it is quite good.
> > On another note, wouldn't Clojure itself or rather a subset of clojure
> > be best to represent data? So to say something like CON?
>
> Yup, for clojure-only applications though there's no need for either
> XML or JSON: we can just use clojure's (prn) (read).
>
Yeah, I made my own ad-hoc transactional caching thing, and it was
quite nice being able to simply print stuff out line by line and then
read it in with { } wrapped around it.
The code is similar to the code for memoise, just with an extra step
of writing stuff to file and reading it in at a certain time.
(interestingly means you can disk cache any fn that is referentially
transparent and returns a clojure structure).
> > Or do I miss something that makes it important for Clojure to be
> > bundled so tightly with XML?
>
> I wouldn't consider Clojure to be bundled tightly with XML. There's a
> single (rather simplistic) clojure.xml module included with the
> language, which provides rudimentary namespace-ignorant XML support.
>
> > Best regards,
> > Heinz
>
> // Ben
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---