aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.clj
diff options
context:
space:
mode:
authorscgilardi <scgilardi@gmail.com>2008-08-07 04:12:43 +0000
committerscgilardi <scgilardi@gmail.com>2008-08-07 04:12:43 +0000
commit16ce0d80ed00b5d2d34470e76ff8349a212609c3 (patch)
treeb02afa5fcafe4788c67d47fe34575e78461708e7 /lib/lib.clj
parentb907de62730004c95585253e816628fa639020e4 (diff)
lib.clj: allow load-libs args to be symbols
Diffstat (limited to 'lib/lib.clj')
-rw-r--r--lib/lib.clj13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/lib.clj b/lib/lib.clj
index c97a17a5..8040e676 100644
--- a/lib/lib.clj
+++ b/lib/lib.clj
@@ -312,13 +312,16 @@
directly or indirectly load via load-namespaces/require/use
:verbose triggers printing information about each load and refer"
[& args]
- (let [libgroupspecs (filter (complement keyword?) args)
+ (let [libargs (filter (complement keyword?) args)
flags (filter keyword? args)
flag-opts (interleave flags (repeat true))]
- (doseq libgroupspec libgroupspecs
- (let [[prefix & libspecs] libgroupspec]
- (doseq libspec libspecs
- (apply load-lib prefix libspec :raw true flag-opts))))))
+ (doseq libarg libargs
+ (if (symbol? libarg)
+ (apply load-lib nil libarg :raw true flag-opts)
+ (let [[prefix & libspecs] libarg]
+ (throw-if (not prefix) "prefix cannot be nil")
+ (doseq libspec libspecs
+ (apply load-lib prefix libspec :raw true flag-opts)))))))
;; Namespaces