$*
is supposed to this kinda thing but I just looked at it and noticed it wasn’t working.
Which is annoying because I thought there were tests for it.
I’ll fix that and then make a new release today.
Is it possible to add a key to a map only if the value assigned to it is other than nil?
simple stupid example
(m/rewrite {:a 1 :b 2}
{:a ?a :b ?b :c ?c}
{:a ?a :b ?b :c (if-not-nil ?c)})
;; => {:a 1, :b 2}
I actually found this, but maybe there is an easier way?
(m/rewrite {:a 1 :b 2}
{:a ?a :b ?b :c ?c}
{:a ?a :b ?b & ~(when ?c [[:c ?c]])})