diff options
author | scgilardi <scgilardi@gmail.com> | 2008-04-03 15:39:31 +0000 |
---|---|---|
committer | scgilardi <scgilardi@gmail.com> | 2008-04-03 15:39:31 +0000 |
commit | dca7f594bf330197244493d918a8bfc7e44f26dc (patch) | |
tree | 3adb3f71abd9b4a4583681fb3d6f74c772151e5a | |
parent | 855acc31afd2392f9ee1b5558edbe792e521dfc9 (diff) |
pkg.clj: automatically 'provide' a package when it is loaded by require
-rw-r--r-- | pkg.clj | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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 |