diff options
author | Stuart Halloway <stu@thinkrelevance.com> | 2010-12-19 08:21:48 -0500 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2010-12-19 08:21:48 -0500 |
commit | ec71724888f46dd447e9cea881b476caf0778270 (patch) | |
tree | be3f6f66caf8777f6c921795ec760a2d0c9260ee | |
parent | 01036ea181b979b5ff190f2eb44c2bf3ca9e1c3b (diff) |
don't recur across try
-rw-r--r-- | modules/find-namespaces/src/main/clojure/clojure/contrib/find_namespaces.clj | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/find-namespaces/src/main/clojure/clojure/contrib/find_namespaces.clj b/modules/find-namespaces/src/main/clojure/clojure/contrib/find_namespaces.clj index 928499c7..b45a7d16 100644 --- a/modules/find-namespaces/src/main/clojure/clojure/contrib/find_namespaces.clj +++ b/modules/find-namespaces/src/main/clojure/clojure/contrib/find_namespaces.clj @@ -54,12 +54,13 @@ unevaluated form. Returns nil if read fails or if a ns declaration cannot be found. The ns declaration must be the first Clojure form in the file, except for (comment ...) forms." - [^PushbackReader rdr] - (try (let [form (read rdr)] - (cond - (ns-decl? form) form - (comment? form) (recur rdr) - :else nil)) + [#^PushbackReader rdr] + (try + (loop [] (let [form (read rdr)] + (cond + (ns-decl? form) form + (comment? form) (recur) + :else nil))) (catch Exception e nil))) (defn read-file-ns-decl |