This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-04
Channels
- # announcements (5)
- # aws (11)
- # babashka (15)
- # beginners (101)
- # biff (14)
- # calva (45)
- # clj-kondo (18)
- # cljs-dev (5)
- # clojure (178)
- # clojure-austin (5)
- # clojure-europe (8)
- # clojure-france (1)
- # clojure-nl (12)
- # clojure-norway (6)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (13)
- # community-development (2)
- # conjure (6)
- # cursive (8)
- # datahike (1)
- # datalevin (3)
- # datascript (36)
- # datomic (6)
- # emacs (2)
- # etaoin (2)
- # fulcro (5)
- # graalvm (6)
- # gratitude (3)
- # introduce-yourself (1)
- # jobs-discuss (1)
- # lsp (19)
- # malli (4)
- # nbb (11)
- # off-topic (4)
- # other-languages (1)
- # pathom (19)
- # pedestal (1)
- # shadow-cljs (22)
- # spacemacs (16)
- # tools-deps (31)
- # vim (7)
Is it possible to make this shorter?
(filter #(and (= "F" (:type %)) (= 61170 (:id %))) matrix)
You could make it shorter, but I wouldn't bother as the code would likely become more obscure
✅ 1
Except, if you can use juxt
of course: (filter (comp #{["F" 61170]} (juxt :type :id)) matrix)
. Just kidding.
2
And throw in a transducer for good measure:
(def my-filter (filter (comp #{["F" 61170]} (juxt :type :id))))
(transduce my-filter conj matrix)
juxt works even better for multiple filters thanks! still need to wrap my head around juxt..