what is the simplest way to use the same value several times?
(m/rewrite [:a :b :c :d]
;; something I don't know
;;
)
;; =>
;; [{:key1 :a :key2 :a :key3 :b} {:key1 :c key2 :c :key3 d}]
Okay, I got it 😉
I'm curious, can you send the solution?
(m/rewrite [:a :b :c :d]
[?x ?y & ?more]
[{:k1 ?x :k2 ?x :k3 ?y} & (m/cata ?more)]
?x nil)
;; => [{:k1 :a, :k2 :a, :k3 :b} {:k1 :c, :k2 :c, :k3 :d}]
@wilkerluciocool, thanks