I'm trying to parse a json object, but my object keys always seem to be strings. Looking at the docstring for js->clj, it seems that setting :keywordize true should convert all string field names to keywords, but either I misunderstand things (quite/very possible), or there's another problem (no!).
A simple example, running the latest clojurescript:
(-> {:abc 123 "def" 456} (clj->js) (js->clj {:keywordize true}))
I would have expected this to return a map with the keys being the keywords :abc and :def, but in this case they're both strings.
So what am I doing wrong/misunderstanding?
Thanks,
Graham
Good point - thanks! Interestingly, I see that this now works:
(-> {:abc 123 "def" 456} (clj->js) (js->clj :keywordize-keys true))
...thought this doesn't:
(-> {:abc 123 "def" 456} (clj->js) (js->clj {:keywordize-keys true}))
...even though the map style of the second is the same as that used in the single argument version of js->clj in the Clojurescript source code.
Just sent a patch to fix this: http://dev.clojure.org/jira/browse/CLJS-1540
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.