Skip to content

Commit

Permalink
don't recur across try
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarthalloway committed Dec 19, 2010
1 parent 01036ea commit ec71724
Showing 1 changed file with 7 additions and 6 deletions.
Expand Up @@ -54,12 +54,13 @@
unevaluated form. Returns nil if read fails or if a ns declaration unevaluated form. Returns nil if read fails or if a ns declaration
cannot be found. The ns declaration must be the first Clojure form cannot be found. The ns declaration must be the first Clojure form
in the file, except for (comment ...) forms." in the file, except for (comment ...) forms."
[^PushbackReader rdr] [#^PushbackReader rdr]
(try (let [form (read rdr)] (try
(cond (loop [] (let [form (read rdr)]
(ns-decl? form) form (cond
(comment? form) (recur rdr) (ns-decl? form) form
:else nil)) (comment? form) (recur)
:else nil)))
(catch Exception e nil))) (catch Exception e nil)))


(defn read-file-ns-decl (defn read-file-ns-decl
Expand Down

0 comments on commit ec71724

Please sign in to comment.