 (defn constant! [x]
   (check (= :constant (:type x))
          (data! (:data x))))
+
+(defn call! [x]
+  (check (= :call (:type x))
+         (ref! (:ref x))
+         (sequential? (:args x))
+         (every? data! (:args x))))
 
 (defn match-any! [x]
   (check (= :match/any (:type x))))

                   (every? pattern! (vals x)))
   :else (check false)))

(defn action! [x]
  (case (:type x)
    :call (check (call! x))
    :constant (check (constant! x))

(defn branch! [x]
  (check (= :match/branch (:type x))
         (pattern! (:pattern x))
         (branch-action! (:action x))))

(defn match! [x]
  (check (= :match (:type x))
         (data! (:arg x))
         (sequential? (:branches x))
         (every? branch! (:branches x))))

