meander

namenu 2024-12-04T16:33:00.460399Z

(into {}
  (m/search {:a {:x 1} :b {:x 2} :c {:x 3}}
            {?k {:x ?v}}
            [?k ?v]))
It seems like an easy question, but I'm struggling. Can I do without into?

2024-12-06T14:56:00.319709Z

(m/rewrite
    {:a {:x 1} :b {:x 2} :c {:x 3}}
    {& (m/seqable [!k {:x !v}] ...)}
    {& (m/seqable [!k !v] ...)})

👍 1
namenu 2024-12-07T07:51:21.918709Z

Maybe I was too simplified the example. What if data contains another map without :x ? for example:

IN: {:a {:x 1} :b {:x 2} :c {:x 3} :d {:y 4}, :e {}}
OUT: {:a 1, :b 2, :c 3}
I have a feeling I should use gather or some, but it's not easy...