Given a vector of maps:
(def my-list
[{:a 1 :b 2 :c 3}
{:a 1 :b 5 :c 6}
{:a 7 :b 8 :c 12}
{:a 10 :b 11 :c 12}])
and a blacklist:
(def blacklist
[{:a 1 :c 3}
{:a 10 :c 12}])
the expected output is:
[{:a 1 :b 5 :c 6}
{:a 7 :b 8 :c 12}]
I came up with:
(defn not-excluded?
[blacklist item]
(not-any? (fn [exclusion-item]
(and (= (:a item) (:a exclusion-item))
(= (:c item) (:c exclusion-item))))
blacklist))
(filter (partial not-excluded? blacklist) my-list)
but there is probably a more idiomatic Clojure way.
:a
and:c
to be hardcoded in the function doesn't look like a good solution. Have you considered passing those as arguments instead? \$\endgroup\$