     (loop [q (qu steps)
            ss []
            env env
-           skip-count {}]
+           skip-count {}
+           skipped #{}]
       (if-let [[k v :as item] (peek q)]
         (let [{; Ignore env from k expansion because values from k are not
                ; stored in env.  This decision may need to be revised in the


(defmethod eval-tagged-literal 'ref
  [tl opts env ks]
  (let [{:keys [:aero.core/incomplete? :aero.core/env :aero.core/value]
         :or {env env}
         :as expansion} (expand (:form tl) opts env ks)]
    (if (or incomplete? (not (contains? env value)))
      (-> expansion
          (assoc ::incomplete? true)
          (update ::value (rewrap tl)))
      (assoc expansion ::value (get env value)))))

(defn- expand-set-keys [m]

               ;env ::env
               k ::value
               k-incomplete? ::incomplete?
               env :aero.core/env
               :or {env env}
               :as k-expansion}
              (expand k opts env (conj ks k ::k))

              {:keys [aero.core/env aero.core/value aero.core/incomplete?]
               :or {env env}
               :as expansion}
              (when-not k-incomplete?
                (expand v opts env (conj ks k)))]
          (if (or k-incomplete? incomplete?)
            (if (<= *max-skips* (get skip-count item 0))
              (recur (pop q)
                     (conj ss [k value])
                     env
                     (update skip-count item (fnil inc 0))
                     (conj skipped (if k-incomplete?
                                     k-expansion
                                     expansion)))
              (recur (conj (pop q) [k value])
                     ss
                     env
                     (update skip-count item (fnil inc 0))
                     skipped))
            (recur (pop q)
                   (conj ss [k value])
                   (assoc env (conj ks k) value)
                   skip-count
                   skipped)))

        {::value (reassemble steps ss)
         ::env env
         ::incomplete? (some #(>= % *max-skips*) (vals skip-count))
         ::incomplete (some ::incomplete skipped)
         ;; Not used anywhere, but useful for debugging
         ::_ss ss}))))

