aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/with_ns.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure/contrib/with_ns.clj')
-rw-r--r--src/clojure/contrib/with_ns.clj13
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#))))