     (apply set/union (map #(deps-from-libspec nil %) (rest form)))))
 
 (defn deps-from-ns-decl
-  "Given a (quoted) ns declaration, returns a set of symbols naming
-  the dependencies of that namespace.  Handles :use and :require
-  clauses but not :load."
+  "Given an (ns...) declaration form (unevaluated), returns a set of
+  symbols naming the dependencies of that namespace.  Handles :use and
+  :require clauses but not :load."
   [decl]
   (apply set/union (map deps-from-ns-form decl)))

  ^{:author "Stuart Sierra",
     :doc "Search for ns declarations in dirs, JARs, or CLASSPATH"} 
  clojure.tools.namespace
  (:require [clojure.java.classpath :as classpath]
            [clojure.set :as set])
  (import (java.io File FileReader BufferedReader PushbackReader
                   InputStreamReader)
          (java.util.jar JarFile)))


;;; Finding namespaces in a directory tree


  (map second (find-ns-decls-in-jarfile jarfile)))


;;; Finding namespaces

(defn find-ns-decls
  "Searches a sequence of java.io.File objects (both directories and
  JAR files) for .clj source files containing (ns...) declarations.
  Returns a sequence of the unevaluated ns declaration forms. Use with
  clojure.java.classpath to search Clojure's classpath."
  [files]
  (concat
   (mapcat find-ns-decls-in-dir (filter #(.isDirectory ^File %) files))
   (mapcat find-ns-decls-in-jarfile (jar-files files))))

(defn find-namespaces
  "Searches a sequence of java.io.File objects (both directories and
  JAR files) for .clj source files containing (ns...) declarations.
  Returns a sequence of the symbol names of the declared
  namespaces. Use with clojure.java.classpath to search Clojure's
  classpath."
  [files]
  (map second (find-ns-decls files)))

;;; Parsing dependencies

