 (defn filter-spec [f spec]
   (filter f (partition 2 spec)))
 
-(defn contains-option? [attr kw]
-  (contains? (attr-options attr) kw))
+(defn contains-options? [attr & keywords]
+  (let [options (attr-options attr)]
+    (reduce #(and %1 (contains? options %2))
+            keywords)))
 
 (defn required-attrs [spec]
   (filter-spec #(= :required (:type (attr-options %)))

  [parsed tail])

(defn choose-parser [spec token]
  (cond (pair-field? spec token) parse-pair
        (enum-field? spec token) parse-enum
        :default parse-ignore))

(defn parse-options [spec item init-results init-unparsed]

(defn parse-items [spec items]
  (map #(parse-item spec %) items))

(def demographic-spec
     [:name {:type :required}
      :age  {:type :required}
      :gender {:enums #{:male :female}}])

(def dick ["dick" 1 :male  ])
(def jane ["jane" 1 :female])

(assert (= (parse-item demographic-spec dick)
           {:gender :male, :age 1, :name "dick"}))

(assert (= (parse-items demographic-spec [dick jane])
           [{:gender :male, :age 1, :name "dick"}
            {:gender :female, :age 1, :name "jane"}]))


