aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscgilardi <scgilardi@gmail.com>2008-04-25 17:16:50 +0000
committerscgilardi <scgilardi@gmail.com>2008-04-25 17:16:50 +0000
commit30b0f082297a861d8ee8d6f0eae4ced68433b95a (patch)
tree1a0d50d8c1c9d1ad3d319f2cddd2c31571e25de5
parent0370d4d689f250d0d9eb14e996d51e7c644bea10 (diff)
lib.clj: tighten up quote detection to allow a lib named quote, fix typo in docs
-rw-r--r--lib.clj15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib.clj b/lib.clj
index 84a6df53..296393da 100644
--- a/lib.clj
+++ b/lib.clj
@@ -38,7 +38,7 @@
;; after ensuring the lib is loaded
;; :reload forces reloading of libs that are already loaded
;; :reload-all implies :reload and also forces reloading of all libs
-;; on which each lib directly or indirectly depend
+;; on which each lib directly or indirectly depends
;; :verbose triggers printing a message each time a lib is loaded
;;
;; The :reload and :reload-all flags supersede :require.
@@ -157,6 +157,15 @@
(when use
(apply refer sym options))))
+(defn- remove-quote
+ "If form is a 'quote' special form, return the unquoted value
+ else return form"
+ [form]
+ (if (and (seq? form)
+ (= 'quote (first form))
+ (= 2 (count form)))
+ (second form) form))
+
;; Foundation
(defn load-libs
@@ -172,9 +181,7 @@
flags (filter keyword? args)
options (interleave flags (repeat true))]
(doseq libspec libspecs
- (let [libspec
- (if (and (seq? libspec) (= 'quote (first libspec)))
- (second libspec) libspec)]
+ (let [libspec (remove-quote libspec)]
(apply load-with-options
((if (symbol? libspec) cons concat)
libspec options))))))