diff options
Diffstat (limited to 'lib/lib.clj')
-rw-r--r-- | lib/lib.clj | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/lib.clj b/lib/lib.clj index 36c5a94e..daa61ea3 100644 --- a/lib/lib.clj +++ b/lib/lib.clj @@ -360,13 +360,19 @@ flags (filter keyword? args) flag-opts (interleave flags (repeat true))] (doseq nsarg nsargs - (if (symbol? nsarg) - (apply load-lib nil nsarg flag-opts) - (let [[prefix & nsspecs] nsarg] - (doseq nsspec nsspecs - (if (symbol? nsspec) - (apply load-lib prefix nsspec flag-opts) - (apply load-lib prefix (concat nsspec flag-opts))))))))) + (cond (symbol? nsarg) + (apply load-lib nil nsarg flag-opts) + (nil? (second nsarg)) + (apply load-lib nil (first nsarg) flag-opts) + (keyword? (second nsarg)) + (apply load-lib nil (concat nsarg flag-opts)) + :else + (let [[prefix & nsspecs] nsarg] + (throw-if (not prefix) "prefix cannot be nil") + (doseq nsspec nsspecs + (if (symbol? nsspec) + (apply load-lib prefix nsspec flag-opts) + (apply load-lib prefix (concat nsspec flag-opts))))))))) (defn namespaces "Returns a sorted set of symbols naming loaded namespaces" |