aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscgilardi <scgilardi@gmail.com>2008-04-03 15:39:31 +0000
committerscgilardi <scgilardi@gmail.com>2008-04-03 15:39:31 +0000
commitdca7f594bf330197244493d918a8bfc7e44f26dc (patch)
tree3adb3f71abd9b4a4583681fb3d6f74c772151e5a
parent855acc31afd2392f9ee1b5558edbe792e521dfc9 (diff)
pkg.clj: automatically 'provide' a package when it is loaded by require
-rw-r--r--pkg.clj8
1 files changed, 3 insertions, 5 deletions
diff --git a/pkg.clj b/pkg.clj
index a076412e..fb4932bc 100644
--- a/pkg.clj
+++ b/pkg.clj
@@ -31,8 +31,8 @@
;;
;; The "force" variations are useful during development.
;;
-;; 'provide' is made available as a separate function (rather than being
-;; done automatically after loading an implementation file) to allow
+;; 'provide' is made available as a separate function (in addition to
+;; being done automatically after loading an implementation file) to allow
;; flexibility in providing a package's capabilities by some means other
;; than loading an implementation file using 'require'.
;;
@@ -100,9 +100,7 @@
(when-not (provided? package)
(let [resource (str package ".clj")]
(load-resource resource)
- (when-not (provided? package)
- (throw (new Exception (str \" resource \"
- " did not provide " package))))))))
+ (provide package)))))
(defn require-ns
"Requires a package and then refers to the namespace of the same name