 
 
 (defn increment-counter
-  "takes an Interpreter and increments its :counter (without otherwise changing it)"
+  "takes an Interpreter and increments its :counter (without otherwise
+  changing it)"
   [interpreter]
   (assoc interpreter :counter (inc (:counter interpreter))))
 
 
 (defn step
-  "Takes an Interpreter, pops one item off :exec, routes it to the router, increments the counter. If the :exec stack is empty, does nothing."
+  "Takes an Interpreter, pops one item off :exec, routes it to the
+  router, increments the counter. If the :exec stack is empty, does
+  nothing."
   [interpreter]
   (let [old-exec (get-stack interpreter :exec)]
     (if (seq old-exec)



(defn boolean?
  "a checker that returns true if the argument is the literal `true` or the literal `false`"
  [item]
  (or (false? item) (true? item)))


(defn instruction?
  "takes an Interpreter and a keyword, and returns true if the keyword is a key of the :instructions registry in that Interpreter instance"
  [interpreter token]
  (contains? (:instructions interpreter) token))


(defn handle-item
  "Takes an Interpreter and an item, and either recognizes and invokes a keyword registered in that Interpreter as an instruction, or sends the item to the correct stack (if it exists). Throws an exception if the Clojure expression is not recognized explicitly as a registered instruction or some other kind of Push literal."
  [interpreter item]
  (cond
    (instruction? interpreter item) (execute-instruction interpreter item)
    (integer? item) (push-item interpreter :integer item)
    (boolean? item) (push-item interpreter :boolean item)
    (char? item) (push-item interpreter :char item)
    (float? item) (push-item interpreter :float item)
    (string? item) (push-item interpreter :string item)
    (list? item) (load-items interpreter :exec item)
    :else (throw
      (Exception. (str "Push Parsing Error: Cannot interpret '" item "' as a Push item.")))))


(defn clear-all-stacks
  "removes all items from all stacks in an Interpreter"
  [interpreter]
  (let [stacklist (keys (:stacks interpreter))]
    (assoc interpreter :stacks (reduce #(assoc %1 %2 '()) {} stacklist))))



(defn reset-interpreter

                        "Unknown Push instruction:'" token "'"))))


(defn- throw-unknown-push-item-error
  [item]
  (throw (Exception. (str 
                        "Push Parsing Error: Cannot interpret '"
                        item
                        "' as a Push item."))))


(defn- add-instruction
  "Takes an Interpreter and an Instruction (record), and adds the
  instruction to the :instructions registry of the interpreter,
