>
> I'm unclear on what the correct course of action in this case should be.
>

However this can be solved by transforming the ratios before and after to
the jsonification: https://gist.github.com/767204

(clojure.walk/postwalk transform-ratio  {:a [3/4] :b {:foo {:bar 3/4} :bar
{:a 1}}})

=> {:a [{:n 3, :d 4, :t "ratio"}], :b {:foo {:bar {:n 3, :d 4, :t "ratio"}},
:bar {:a 1}}}

(clojure.walk/postwalk transform-ratio (clojure.walk/postwalk
transform-ratio  {:a [3/4] :b {:foo {:bar 3/4} :bar {:a 1}}}))

=> {:a [3/4], :b {:foo {:bar 3/4}, :bar {:a 1}}}

... and now with json:

(clojure.walk/postwalk
  transform-ratio
  (json/read-json
    (json/json-str (clojure.walk/postwalk transform-ratio
                                                        {:a [3/4] :b {:foo
{:bar 3/4} :bar {:a 1}}}))))
=> {:a [3/4], :b {:foo {:bar 3/4}, :bar {:a 1}}}


Thanks to benreesman, amalloy and fliebel in #clojure for guiding me this
way.

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

Reply via email to