meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
2021-05-11T20:43:11.234100Z

what is the simplest way to use the same value several times?

2021-05-11T20:45:02.234400Z

(m/rewrite [:a :b :c :d]
  ;; something I don't know
  ;;
  )
;; =>
;; [{:key1 :a :key2 :a :key3 :b} {:key1 :c key2 :c :key3 d}]

2021-05-11T20:48:49.234800Z

Okay, I got it 😉

wilkerlucio 2021-05-11T20:49:20.234900Z

I'm curious, can you send the solution?

2021-05-11T20:59:21.235500Z

(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}]
@wilkerlucio

wilkerlucio 2021-05-11T21:05:08.235800Z

cool, thanks