meander

Stephan Renatus 2024-12-28T12:57:06.528309Z

Heya! šŸ‘‹ Using meander.strategy.epsilon/rewrite, is there a way to combine a memory variable via a clojure function? I’d like to turn

[{:var "foo"}, {:var "bar"}]
into
"foo.bar"
but all my current attempts fail 😳

āœ… 1
Stephan Renatus 2024-12-28T12:58:14.844409Z

(let [rewrite
        (r/until =
          (r/bottom-up
           (r/attempt
            (r/rewrite
              [{:var !x} ... ]
              ~(clojure.string/join "." [!x ...])
            ))))] ...)
is my current attempt

Stephan Renatus 2024-12-28T16:00:03.777869Z

realised what I was missing just when I left the computer: m/app.

(m/app (fn [x] (clojure.string/join "." x)) [!x ...])
this works. it can be simplified, but just to close the thread.