This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-27
Channels
- # announcements (12)
- # babashka (18)
- # bangalore-clj (3)
- # beginners (110)
- # calva (14)
- # cestmeetup (4)
- # cider (4)
- # clj-kondo (2)
- # clojure (34)
- # clojure-colombia (5)
- # clojure-europe (11)
- # clojure-nl (8)
- # clojure-spec (19)
- # clojure-uk (11)
- # clojurescript (16)
- # clojureverse-ops (8)
- # community-development (4)
- # conjure (65)
- # core-async (19)
- # cursive (22)
- # data-science (7)
- # datascript (1)
- # datomic (20)
- # devcards (1)
- # figwheel-main (64)
- # fulcro (10)
- # graalvm (3)
- # helix (3)
- # kaocha (22)
- # malli (68)
- # meander (6)
- # off-topic (39)
- # pathom (6)
- # pedestal (2)
- # reagent (5)
- # remote-jobs (2)
- # reveal (30)
- # rum (4)
- # shadow-cljs (83)
- # specter (3)
- # tools-deps (9)
- # xtdb (18)
(into {} (m/search {:a nil :b 10 :c 20 :d nil}
{?k (m/some ?v)} {?k ?v})) ;; {:b 10, :c 20}
I feel like there's going to be a neater solution to this?(m/rewrite {:a nil :b 10 :c 20 :d nil}
(m/gather [!k (m/some !v)])
{& [[!k !v] ...]})
There's another way of doing it.Oh wait, forgot about map-of
(m/rewrite {:a nil :b 10 :c 20 :d nil}
(m/gather [!k (m/some !v)])
(m/map-of !k !v))
ah, so gather is the proper way to collect the keys such that I can then map-of with them. I tried map-of a lot and got nowhere.
Yeah in this case gather is equivalent to
(m/rewrite {:a nil :b 10 :c 20 :d nil}
(m/seqable (m/or [!k (m/some !v)] _) ...)
(m/map-of !k !v))