Fork me on GitHub
#specter
<
2021-12-17
>
jmv20:12:34

hey all, i'm trying to write a transformation to replace all matching continuous subsequences with a new value. it looks like there is https://github.com/redplanetlabs/specter/issues/236 to simplify this, but i was wondering what's the best way to accomplish it today. as an explicit example, i'm trying to do something like this:

(def data [0 0 0 1 2 3 0 0 1 2 0 0 1 2 3])
(s/setval [???] :A data) ;; replace each continuous [1 2 3] with :A
;;=> [0 0 0 :A 0 0 1 2 0 0 :A]