   (is (not (match '(1 (! x) 3) '(1 (2) 3))))
   (is (not (match '((? x) 3) '(1 2)))))
 (defn =1? [x] (= x 1))
-(defn =1?-state [d x] (and (= x 1) (assoc d 'x 'is-1)))
 (defn function-pattern-match-test [match f]
   (is (= {'x 1 'y 2} (match '((chapter3.match/=1? x) (? y) 3) '(1 2 3))))
   (is (not (match '((chapter3.match/=1? x) 2 3) '(2 2 3)))))

             (= (count (first p)) 2)
             (resolve (first (first p))))
        (when-let [update-d ((resolve (first (first p))) @variables (first s))]
          (when (match-helper (rest p) (rest s))
            (swap! variables (fn [vs] (assoc (merge vs update-d) (second (first p)) (first s))))
            true))
        :else false))
    (if (match-helper p s) @variables false))
  (basic-match-test match-state)
  (basic-pattern-match-test match-state)
  (is (not (match-state '(1 (2) 3) '(1 (2) 3))) "malformed pattern")
  (is (= {'x 1 'y 2} (match-state '((chapter3.match/=1?-state x) (? y) 3) '(1 2 3))))
  (is (not (match-state '((chapter3.match/=1?-state x) 2 3) '(2 2 3))))
  (star-pattern-match-test match-state chapter3.match/=1?-state))

        (and (not (empty? s))
             (= (count (first p)) 2)
             (= (first (first p)) '?))
        (do
          (swap! variables (fn [vs] (assoc vs (second (first p)) (first s))))
          (match-helper (rest p) (rest s)))
        (and (= (count (first p)) 2)
             (= (first (first p)) '*))
        (cond
