Hello,
weird, I know, but I have keywords in a map like this:
:first/second
I want to convert such a keyword to a string and I'm doing this with the
name function. This doesn't work with a slash:
(def x :first/second)
(name x)
second
(The reason why I have such keywords at all is that
Hi,
(defn to-string-keys
[the-map]
(into (empty the-map) (for [[k v] the-map] [(if-let [nspace (namespace
k)] (str nspace / (name k)) (name k)) v])))
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send
I'm impressed. Thank you very much!
--
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
Hi,
keywords can qualified - just as symbols. Compare: :foo, :user/foo, ::foo
(assuming you are in a fresh REPL). You can also use namespace aliases:
(require '[some.name.space :as short]) ::short/foo.
(shameless-promotion self http://bit.ly/cqbm6F)
Sincerely
Meikel
--
You received this