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.
(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)))
Comments top
No comments for read-file-ns-decl. Log in to add a comment.