specter

Latest version: 1.1.3
axrs 2019-02-19T02:33:56.002500Z

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}]

nathanmarz 2019-02-19T13:20:37.003100Z

@axrs ALL navigates you into the value, so you're no longer in the context of the sequence

nathanmarz 2019-02-19T13:21:01.003700Z

you can accomplish your goal by using the zipper navigators