     (macros form)
 
     (symbol? form)
-    (if (fns form)
+    (if (some #(= (:name %) form) fns)
       [[:ldf form]]
       [[:ld 0 (.indexOf vars form)]])
 

   :post [(string? %)]}
  (let [prog (java.io.PushbackReader. (clojure.java.io/reader file))]
    (loop [form (read prog false nil)
           fns {}]
      (if form
        (let [func (compile-function form fns)]
          (recur (read prog false nil) (assoc fns (:name func) func)))
        (-> fns
            (generate-main)
            (generate-prelude)

(defn compile-function
  [[name args & body :as code] fns]
  {:pre [(list? code)]}
  (let [fns (conj fns {:name name})
        [stmt & stmts] (mapcat #(compile-form args fns %) body)
        code (concat [(conj stmt (format "; define %s" name))]
                     stmts
