This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-25
Channels
- # aws (2)
- # bangalore-clj (2)
- # beginners (90)
- # boot (89)
- # bristol-clojurians (1)
- # cider (23)
- # cljs-dev (48)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (118)
- # clojure-argentina (3)
- # clojure-austin (8)
- # clojure-czech (1)
- # clojure-dev (18)
- # clojure-ireland (1)
- # clojure-italy (4)
- # clojure-russia (6)
- # clojure-spec (75)
- # clojure-uk (224)
- # clojurescript (103)
- # core-async (28)
- # cursive (3)
- # datascript (7)
- # datomic (15)
- # dirac (30)
- # emacs (14)
- # events (3)
- # figwheel (1)
- # hispano (1)
- # hoplon (176)
- # lambdaisland (1)
- # lein-figwheel (6)
- # off-topic (21)
- # om (7)
- # onyx (2)
- # pedestal (6)
- # re-frame (4)
- # reagent (15)
- # spacemacs (67)
- # specter (13)
- # testing (9)
- # untangled (65)
- # vim (6)
- # yada (1)
Hey Natan its seems that subset does not fit the bill in my case because the values that I'm replace are based on a pred
(tranform [:one (pred keyword?)] (fn [_] [[1 2] [3 4]]) {:one #{:two}})
Ok managed to solve it
Since my kewords are days its closed set (so subset works) but id be curious on how you can use pred to substitute values
@narkisr you would need to iterate over all the values and check the predicate against each value
ALL
isn't currently implemented for sets though
you could either use a vector there instead of a set or make an ALL-SET-ELEMS
navigator
(or open a pull request to extend ALL
to sets)
Thank you Natan, ill take a look on what it takes to add support for that
@narkisr need to extend AllTransformProtocol
to PersistentHashSet
https://github.com/nathanmarz/specter/blob/master/src/clj/com/rpl/specter/navs.cljc#L87
@narkisr actually just realized that ALL
already handles sets via the default case, it's just not optimized like the other data structures