I'm just starting out with Specter, so this is probably an easy question. I have a hashmap and a set of keys to remove from it. But can't quite figure out how to navigate to the keys based on that set.
I am still a specter noob myself, but I am putting how I would do this so maybe others can point out better ways to do this
(sp/setval [sp/ALL (fn [[k _]] (#{:a :b} k))] sp/NONE {:a 1 :b 2 :c 3})
=> {:c 3}Thanks. I feed doubly silly because what was holding me back from the right answer was passing the params to clojure.set/difference in the wrong order 😕
In the end, this line worked!
(transform [ATOM :arcs MAP-KEYS diff] NONE hackstate)
Which is so much nicer than the doseq version I temporarily worked with.There's a few ways, one is MAP-KEYS #{:k1 :k2} as path for setval NONE