Fork me on GitHub
#beginners
<
2016-01-09
>
plaxdan01:01:12

What’s the idiomatic way to convert some JSON received from a web service to EDN?

jonahbenton02:01:48

a JSON parsing lib like cheshire https://github.com/dakrone/cheshire will turn a string of JSON received from a web service into ordinary clojure data structures- see the parse-string function. to then encode ordinary clojure data into EDN, use pr.

plaxdan18:01:32

Re: question above, can’t believe I hadn’t seen js->clj and clj->js. As it happens, the http lib I was using had already performed the conversion. https://github.com/r0man/cljs-http/blob/990bfb0a4be92f929c429f2999cb182d79cdbf75/src/cljs_http/util.cljs#L64

tord19:01:23

Embarrassingly stupid question: What's the Clojure equivalent of makunbound?

tord19:01:45

I found it just after asking. It's ns-unmap.