 (defmethod print-method Env [env writer]
   (.write writer (str "#" (print-str (class env)) "{:frames " (frames env) "}")))
 
-(defn env-value [vm-state {:keys [frame slot]}]
+(defn env-value
   "Return the value at position `[frame slot]` in `vm-state`'s
   environment.  This is similar to `(get-in env [frame slot])` but
   throws if the index is out of bounds (which can only result from a
   compiler error)."
+  [vm-state {:keys [frame slot]}]
   (let [env (:env vm-state)
         frame-vector (nth env frame)]
     (nth frame-vector slot)))
 
-(defn set-local-var-from-stack [{:keys [env stack] :as vm-state} {:keys [frame slot]}]
+(defn set-local-var-from-stack
   "Set the value at position `[frame slot]` in `vm-state`'s
   environment to `new-value`."
+  [{:keys [env stack] :as vm-state} {:keys [frame slot]}]
   (assoc vm-state
     :env (assoc-in (:env vm-state) [frame slot] (peek stack))
     :stack (pop (:stack vm-state))))

  VmInst
  (-step [this vm-state]
    (assoc vm-state :stack
           (make-fn :code (assemble '((args 1)
                                      (lvar 1 0 stack)
                                      (set-cc)
                                      (lvar 0 0 fun)
                                      (return)))
                    :env (->Env [(:stack vm-state)])
                    :name '%cc
                    :args '[fun])))

  (-opcode [this]
    'CALLJ))

(defn move-args-from-stack-to-env
  "If `n-rest-args` is falsy, pop `n-args` arguments from the stack
  and put them in a newly created environment frame.  If `n-rest-args`
  is truthy it must be an integer, in that case `n-args` +
  `n-rest-args` arguments are popped from the stack; the first
  `n-args` are put in individual slots in the newly created
  environment frame, the last `n-rest-args` are collected into a
  vector and put in the (`n-args` + 1)st slot in the new environment
  frame."
  [n-args vm-state & n-rest-args]
  (let [stack (:stack vm-state)
        tmp-frame (vec (take n-args stack))
        tmp-stack (drop n-args stack)
