Fork me on GitHub
#specter
<
2019-01-10
>
roklenarcic11:01:13

I'm having problems expressing the following: I want to find an element in the vector, and edit that, but if it doesn't exist I want to add a default element to the vector

nathanmarz15:01:57

@roklenarcic you can do this:

(multi-transform
  [(if-path [ALL (pred= :a)]
     [ALL (pred= :a) (terminal-val :c)]
     [AFTER-ELEM (terminal-val :DEFAULT)]
     )]
  [:b :a :b])

nathanmarz15:01:06

can probably do it more efficiently with a custom navigator