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