Fork me on GitHub

@nathanmarz wow…that is some kung-fu. Am I reading that right that we are essentially selecting a bunch of nodes in the datastructure as targets for the setval and then assigning using a vector and out comes the transformed data structure? That is perhaps the coolest statement I’ve seen so far from specter. I rewrote the subseelct path as (subselect ALL (pred :repeat) :apply-for), seems to do the same thing. Naturally the reward for an awesome answer is another question…is there a way in specter to select the node after a node we match in a vector, i.e. assume a vector:

[:a :b :c :d :e 1 :f :g]
and I would like to select the item after :e


subselect lets you manipulate an arbitrary selection path as a sequence, where changes to the sequence apply at the original locations


@mbjarland you can do that with zippers


also possible with srange-dynamic


or you can make a custom navigator