This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-13
Channels
- # aleph (3)
- # announcements (2)
- # aws (48)
- # babashka (93)
- # beginners (101)
- # bristol-clojurians (1)
- # cider (3)
- # clj-kondo (17)
- # cljdoc (1)
- # cljsrn (3)
- # clojure (208)
- # clojure-dev (2)
- # clojure-europe (19)
- # clojure-italy (18)
- # clojure-losangeles (16)
- # clojure-nl (8)
- # clojure-spec (21)
- # clojure-sweden (8)
- # clojure-uk (57)
- # clojuredesign-podcast (6)
- # clojurescript (10)
- # code-reviews (6)
- # core-typed (1)
- # cryogen (7)
- # cursive (38)
- # datomic (34)
- # duct (13)
- # emacs (13)
- # fulcro (16)
- # funcool (2)
- # graalvm (1)
- # lambdaisland (5)
- # luminus (8)
- # lumo (1)
- # malli (2)
- # off-topic (12)
- # pathom (9)
- # re-frame (13)
- # reagent (11)
- # ring (3)
- # shadow-cljs (15)
- # sql (19)
- # tools-deps (61)
- # xtdb (23)
If I have a map of fully qualified keys, i.e, {:foo/bar "baz" :foo/wibble "wobble"}
, is there a better way to return a new map with the namespace removed, i.e., :foo/
, leaving just :bar
? So, the result would be {:bar "baz" :wibble "wobble"}
. My initial attempt is this (map #(s/rename-keys % {:foo/bar :bar :foo/wibble :wobble}))
and use that in a transducer.
The downside of my approach is that I need to know every key name, whereas I just want to throw a map to something, with a prefix and say, remove all :foo/
thank you very much sir!
(into {} (map (fn [[k v]] [(keyword (name k)) v])) m)
is a more general way to do it