Let ns-exists? return true on generated namespaces

fixes #2204
This commit is contained in:
Jean Niklas L'orange 2016-09-20 23:01:32 +02:00
parent d605bd3563
commit 716d833f48

View file

@ -69,12 +69,13 @@
(.. base-uri (relativize path-uri) (getPath))))
(defn ns-exists? [namespace]
(or (find-ns (symbol namespace))
(some (fn [suffix]
(-> (#'clojure.core/root-resource namespace)
(subs 1)
(str suffix)
io/resource))
[".clj" ".cljc" (str clojure.lang.RT/LOADER_SUFFIX ".class")]))
[".clj" ".cljc" (str clojure.lang.RT/LOADER_SUFFIX ".class")])))
(defn error [& args]
(binding [*out* *err*] ;; TODO: use main/warn for this in 3.0