This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-19
Channels
- # announcements (1)
- # aws (9)
- # beginners (136)
- # boot (4)
- # cider (11)
- # clara (36)
- # clojure (337)
- # clojure-europe (5)
- # clojure-italy (3)
- # clojure-nl (2)
- # clojure-spec (9)
- # clojure-uk (112)
- # clojured (7)
- # clojurescript (93)
- # core-async (2)
- # cursive (30)
- # datomic (6)
- # duct (4)
- # emacs (2)
- # figwheel (1)
- # figwheel-main (7)
- # fulcro (153)
- # kaocha (1)
- # off-topic (12)
- # om-next (1)
- # pedestal (58)
- # planck (6)
- # re-frame (15)
- # reitit (11)
- # shadow-cljs (113)
- # spacemacs (1)
- # specter (3)
- # vim (8)
Is it possible to insert a value after a predicate match with specter? I thought AFTER-ELEM
would work, but it converts map to a sequence ([:spec :test-2] :inserted)
Something like:
(sp/setval
[sp/ALL (comp (partial = :test-2) :spec) sp/AFTER]
:inserted
[{:spec :test} {:spec :test-2} {:spec :test-3}])
I'm looking for the result to be:
[{:spec :test} {:spec :test-2} :inserted {:spec :test-3}]
@axrs ALL
navigates you into the value, so you're no longer in the context of the sequence
you can accomplish your goal by using the zipper navigators