 (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)))])

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

(defn new-env
  [bindings old-env]
  {:bindings bindings ; TODO what's the type of `bindings`?  vector?  map?  set?
   :parent old-env})


(defn f-symbol

  ; todo: ... everything! ...
  log)

(defn m-seq
  [nodes log env]
  (loop [log-n log node-n nodes]
    (if (empty? node-n)
        log-n
        (recur (f-node (first node-n) log-n env) (rest node-n)))))

(defn f-let
  "recurs on: value of each binding, form"
  ; todo: unique symbols?
  [node log env]
  (let [log-2 (m-seq (map second (node :bindings)) log env)]
    (f-node (node :body)
            log-2
            (new-env (apply hash-set (map first (node :bindings))) env))))

(defn f-app
  [node log env]
  (let [log2 (f-node (node :function) log env)]
    (m-seq (node :arguments) log2 env)))

(def actions
 {"symbol"      f-symbol
