I'm new to Clojure and I was wondering if there was a way to test if a map has multiple keys. I've noticed that contains?
only checks for one key
What i'm trying to do:
(def mario
{:position {:x 1 :y 2}
:velocity {:x 2 :y 0}
:mass 20})
;;Test if mario has a position and a velocity
(contains-many? mario :position :velocity) ;;true
;;Test if mario has a mass and a jump-height
(contains-many? mario :mass :jump-height) ;;false
basically, is there a function like contains-many?
in the clojure library and if not how would you implement the contains-many?
function?
#(contains? m %)
Is this like currying or pattern-matching or something? – Vanhook