This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-26
Channels
- # announcements (2)
- # beginners (46)
- # calva (16)
- # cider (5)
- # clj-kondo (1)
- # cljdoc (11)
- # cljsrn (4)
- # clojure (42)
- # clojure-dev (2)
- # clojure-spec (6)
- # clojure-uk (1)
- # clojurescript (18)
- # cursive (7)
- # datomic (18)
- # duct (1)
- # fulcro (11)
- # graalvm (1)
- # hoplon (9)
- # leiningen (1)
- # off-topic (8)
- # shadow-cljs (16)
- # spacemacs (9)
- # specter (3)
- # sql (33)
- # vim (3)
- # xtdb (8)
Is there an equivalent to select-keys? I'm currently trying to translate some of my vanilla clojure code to using specter (great library by the way, I use it in almost all my projects), and trying to navigate to a view of all the values in a map where the key for it is contained in some collection seems to me to be a not-uncommon usecase. I've tried a couple of solutions for it, from using (apply multi-path (map keypath coll))
to (filterer (comp set-name first))
and no matter what I do, the performance is always at least twice as poor as just calling select-keys
. I've been perusing the docs, but nothing is jumping out at me.
I see that submap
is what I was looking for
submap
has much more acceptable performance, being only slightly slower than the select-keys
implementation. Again, thanks for the library!