This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-14
Channels
- # beginners (33)
- # cider (17)
- # clara (13)
- # cljs-dev (7)
- # clojars (1)
- # clojure (47)
- # clojure-brasil (1)
- # clojure-dev (4)
- # clojure-italy (3)
- # clojure-russia (4)
- # clojure-uk (1)
- # clojurescript (4)
- # core-async (4)
- # core-logic (6)
- # cursive (7)
- # datomic (1)
- # emacs (35)
- # fulcro (56)
- # hoplon (7)
- # jobs-discuss (89)
- # lumo (6)
- # numerical-computing (1)
- # onyx (86)
- # parinfer (3)
- # reagent (2)
- # rum (2)
- # specter (5)
- # sql (13)
- # unrepl (2)
@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