Permalink
Browse files

don't recur across try

  • Loading branch information...
stuarthalloway committed Dec 19, 2010
1 parent 01036ea commit ec71724888f46dd447e9cea881b476caf0778270
Showing with 7 additions and 6 deletions.
  1. +7 −6 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

0 comments on commit ec71724

Please sign in to comment.