👋 new guy here. I hope my question is simple: I'm looking for a way to map a function to a specific set of indices within a collection. For example:
(transform [ALL MAP-VALS [1 3 5]] inc [0 1 2 3 4 5 6])
;; wishful thinking => [0 2 2 4 4 6 6]
is such a thing straight-forward in specter
?@loganpowell something like (transform [INDEXED-VALS (selected? FIRST #{1 3 5}) LAST] inc [0 1 2 3 4 5 6])
works. Not sure if it's the best solution though.
@drowsy Thank you thank you
works like a charm!
@loganpowell shorter and faster version:
user=> (transform (multi-path 1 3 5) inc [0 1 2 3 4 5 6])
[0 2 2 4 4 6 6]
@schmee Boom! Thank you!