diff options
Diffstat (limited to 'src/clojure/contrib/with_ns.clj')
-rw-r--r-- | src/clojure/contrib/with_ns.clj | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/clojure/contrib/with_ns.clj b/src/clojure/contrib/with_ns.clj index be33dd7c..d874a4a5 100644 --- a/src/clojure/contrib/with_ns.clj +++ b/src/clojure/contrib/with_ns.clj @@ -29,9 +29,10 @@ "Evaluates body in an anonymous namespace, which is then immediately removed. The temporary namespace will 'refer' clojure.core." [& body] - `(do (create-ns 'sym#) - (let [result# (with-ns 'sym# - (clojure.core/refer-clojure) - ~@body)] - (remove-ns 'sym#) - result#))) + `(try + (create-ns 'sym#) + (let [result# (with-ns 'sym# + (clojure.core/refer-clojure) + ~@body)] + result#) + (finally (remove-ns 'sym#)))) |