Fork me on GitHub
#specter
<
2016-09-22
>
nathanmarz00:09:29

@puzzler STAY is common with recursive navigators, the README has one for navigating a tree represented by nested vectors. Also continue-then-stay and stay-then-continue use it https://github.com/nathanmarz/specter/blob/master/src/clj/com/rpl/specter.cljc#L1061

nathanmarz00:09:12

as for value collection, it's something I use constantly, especially for more sophisticated transformations

nathanmarz00:09:58

those graph navigators aren't public, but that takes an ancestry graph and adds a field to each node for the "royal name" which is "{name} of {parent1}, {parent2}..."

nathanmarz00:09:35

it navigates to each :royal-name field to create and along the way collects what it needs to compute that value – the parent names and the name for this node

nathanmarz00:09:56

the only places I use STOP are in conjunction with protocol paths, essentially saying there's nothing to navigate to for that type

puzzler23:09:53

Is there a way to splice things into lists with specter? For example, I want to find all the [:c :d] pairs and splice them like so: [:a :b [:c :d] :e [:c :d]] should yield [:a :b :c :d :e :c :d].

puzzler23:09:58

NM. I figured out a way to do it using continuous-subseqs.