1.2.0 permalink Arrow_down_16x16
  • (read-file-ns-decl file)
Attempts to read a (ns ...) declaration from file, and returns the
unevaluated form. Returns nil if read fails, or if the first form
is not a ns declaration.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/find_namespaces.clj:65 top

(defn read-file-ns-decl
  "Attempts to read a (ns ...) declaration from file, and returns the
  unevaluated form.  Returns nil if read fails, or if the first form
  is not a ns declaration."
  [^File file]
  (with-open [rdr (PushbackReader. (BufferedReader. (FileReader. file)))]
    (read-ns-decl rdr)))
Vars in clojure.contrib.find-namespaces/read-file-ns-decl: defn with-open
Used in 0 other vars

Comments top

No comments for read-file-ns-decl. Log in to add a comment.