This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-02
Channels
- # announcements (2)
- # aws (13)
- # beginners (52)
- # boot (10)
- # calva (2)
- # cider (23)
- # clara (23)
- # cljs-dev (16)
- # cljsrn (5)
- # clojure (69)
- # clojure-brasil (1)
- # clojure-conj (3)
- # clojure-dev (41)
- # clojure-india (2)
- # clojure-italy (39)
- # clojure-nl (5)
- # clojure-russia (2)
- # clojure-spec (5)
- # clojure-uk (51)
- # clojurescript (78)
- # code-reviews (13)
- # data-science (2)
- # datascript (22)
- # datomic (47)
- # duct (13)
- # emacs (4)
- # figwheel-main (45)
- # fulcro (85)
- # funcool (4)
- # jobs (9)
- # nrepl (106)
- # off-topic (5)
- # pathom (7)
- # pedestal (2)
- # re-frame (17)
- # reagent (32)
- # reitit (7)
- # ring-swagger (2)
- # shadow-cljs (33)
- # spacemacs (4)
- # specter (2)
- # tools-deps (203)
- # vim (1)
This works:
(set/map-invert (java.util.HashMap. {:foo :bar}))
This also works:
(set/map-invert [[:a 1] [:b 2]])
Even this works:
(set/map-invert ["a1" "b2"])
{\1 \a, \2 \b}
Any reducible coll of nth-able pairs will do. How far should we go with the spec for set/map-invert
?@danielcompton I added some test helpers here: https://github.com/slipset/speculative/blob/master/src/speculative/test.cljc
(`success?` and gentest
, combined into this test util, also named gentest
: https://github.com/slipset/speculative/blob/master/test/speculative/test_utils.cljc#L22)
Nice 👍