 (fact "clear-locals also does what it's supposed to do"
   (let [foo (store-local (make-interpreter) :foo 8)]
     (:locals (clear-locals foo)) => nil))
+
+
+(defn recall
+  [interpreter k]
+  (get-in interpreter [:locals k]))
+
+
+(fact "recall retrieves a named item from :locals of its interpreter"
+  (let [foo (store-local (make-interpreter) :foo 8)]
+  (recall foo :foo) => 8))
+
+;;
 
 
 (defn consume

; - `remember-stack [stackname :as local]`
;    save the entire stack to the `local`
;    raise an Exception if it's undefined
; - `place [stackname item]`
;    push the item to the named stack
;    raise an Exception if it's undefined
; - `replace-stack [stackname new-stack]`
;    replace the indicated stack with a new list
;    raise an exception if it's undefined
; - `calculate [fn :as local]
;    save the result of `fn` under key `local`

;; And I THINK that supports all defined Push instructions I've ever seen....




(defn place
  [interpreter stack function]
  (let [result (apply function [interpreter])]
    (push-item interpreter stack result)))


(fact "`place` will apply the specified inline function to the interpreter"
  (let [integer-added (-> six-ints
                        (consume :integer :as :int1)
                        (consume :integer :as :int2)
                        (place :integer #(+ (recall % :int1) (recall % :int2))))]
  (get-stack integer-added :integer) => '(11 4 3 2 1)))


(fact "`place` pays attention the argument order"
  (let [integer-subtracted (-> six-ints
                        (consume :integer :as :int1)
                        (consume :integer :as :int2)
                        (place :integer #(- (recall % :int1) (recall % :int2))))]
  (get-stack integer-subtracted :integer) => '(1 4 3 2 1)) 
  (let [integer-subtracted (-> six-ints
                        (consume :integer :as :int1)
                        (consume :integer :as :int2)
                        (place :integer #(- (recall % :int2) (recall % :int1))))]
  (get-stack integer-subtracted :integer) => '(-1 4 3 2 1)))


;; this would be nicer if it was 
;; (place :integer #(- (my :int2) (my :int1)))



; (def-pushinstruction
