Fork me on GitHub
#specter
<
2017-02-20
>
souenzzo21:02:26

Hi! There is some docs to recursive-path? I'm trying to do: [:a {:b [:c]}] -> [:a {:b [:c :x]} :x] (position of x don't matter) (append x to all vector? level's)

nathanmarz21:02:02

@souenzzo it's just (recursive-path [] p ...)

nathanmarz21:02:10

where p refers to itself

nathanmarz21:02:54

navigating to all levels of the vector can be done: (recursive-path [] p (if-path vector? (continue-then-stay ALL p)))

nathanmarz21:02:24

with 0.13.3-SNAPSHOT can do:

user=> (def p (recursive-path [] p (if-path vector? (continue-then-stay ALL p))))
#'user/p
user=> (setval [p AFTER-ELEM] :x [1 [2 3] [[4]]])
[1 [2 3 :x] [[4 :x] :x] :x]