 (def eg1
   [(make-def 'id (make-fn '(x) 'x))
    (make-app 'f '[x y])
-   (make-let '#{f x} (make-app 'f '[x y]))
+   (make-let '[[f g] [x z]] (make-app 'f '[x y]))
    (make-def '. (make-fn '(f g x) '(f (g x))))
    (make-def 'd (make-fn '(x) '(x x)))
    (make-def 't (make-fn '(f x) '(. f f x)))])


(defn f-node
  [node log env]
  (do (prn (str "checking ..." node)))
  (let [type (my-type node)]
    (if (contains? actions type)
        ((actions type) node log env)
        (throw (new Exception (str "unrecognized node type -- " node))))))


(def root-env (new-env #{} nil))

(defn run-eg
  ([] (run-eg (second eg1)))

  [sym env]
  (cond 
    (nil? env) nil
    (contains? (env :bindings) sym) (env :depth)
    :else (recur sym (env :parent))))

(defn new-env
  [bindings old-env]
  (doseq [x bindings]
    (or (symbol? x)
        (throw (new Exception "new-env: requires symbols for bindings"))))
  {:bindings bindings
   :parent old-env
   :depth (+ 1 (:depth old-env))})


(defn f-symbol
