From f2a864b2e1353f522a0b1d13310b42bbf61cf49e Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 2 Mar 2014 10:21:11 -0500 Subject: [PATCH] to be consistent, we should be converting keys this way here too --- src/clj_jtwig/convert.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/clj_jtwig/convert.clj b/src/clj_jtwig/convert.clj index 56bff81..a70557f 100644 --- a/src/clj_jtwig/convert.clj +++ b/src/clj_jtwig/convert.clj @@ -15,9 +15,7 @@ (.entrySet) (reduce (fn [m [k v]] - ; TODO: perhaps we should be doing (keyword k) instead? i don't like that it technically is not an - ; exact conversion if we do it that way though, even if it is more idiomatic for clojure ... - (assoc m k (to-clojure v))) + (assoc m (to-clojure k) (to-clojure v))) {}))) java.lang.Number @@ -36,6 +34,10 @@ (to-clojure [x] x) + clojure.lang.Keyword + (to-clojure [x] + x) + java.lang.Object (to-clojure [x] (-> x @@ -80,4 +82,4 @@ (defn clojure->java "converts a clojure value to an equivalent value using a java object" [x] - (to-java x)) + (to-java x)) \ No newline at end of file