specter

Latest version: 1.1.3
mbjarland 2018-01-14T14:25:01.000094Z

@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

nathanmarz 2018-01-14T14:29:23.000062Z

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

nathanmarz 2018-01-14T14:30:12.000166Z

@mbjarland you can do that with zippers

nathanmarz 2018-01-14T14:30:31.000063Z

also possible with srange-dynamic

nathanmarz 2018-01-14T14:30:50.000059Z

or you can make a custom navigator