On Oct 15, 2008, at 3:22 AM, Paul Drummond wrote:
> Hmmm. Now I am getting this: > > (require 'clojure.contrib.zip-filter :as 'zf) > java.lang.ClassCastException: java.lang.Boolean cannot be cast to > clojure.lang.Symbol (NO_SOURCE_FILE:0) > > Any ideas? I've enclosed a patch to boot.clj that will give a clearer error message in this case: user=> (require 'clojure.contrib.zip-filter :as 'zf) java.lang.IllegalArgumentException: not a libspec or prefix list: :as (NO_SOURCE_FILE:0) --Steve diff --git src/clj/clojure/boot.clj src/clj/clojure/boot.clj index 7de6888..d27b0a1 100644 --- src/clj/clojure/boot.clj +++ src/clj/clojure/boot.clj @@ -3168,20 +3168,28 @@ (printf ")\n")) (apply refer lib (mapcat seq filter-opts)))))) +(def list?) + (defn- load-libs "Loads libs, interpreting libspecs, prefix lists, and flags for forwarding to load-lib" [& args] - (let [flags (filter keyword? args) + (let [flag? #{:reload :reload-all :require :use :verbose} + flags (filter flag? args) opts (interleave flags (repeat true)) - args (filter (complement keyword?) args)] + args (filter (complement flag?) args)] (doseq arg args - (if (libspec? arg) - (apply load-lib nil (prependss arg opts)) - (let [[prefix & args] arg] - (throw-if (nil? prefix) "prefix cannot be nil") - (doseq arg args - (apply load-lib prefix (prependss arg opts)))))))) + (cond (libspec? arg) + (apply load-lib nil (prependss arg opts)) + (list? arg) + (let [[prefix & args] arg] + (throw-if (nil? prefix) "prefix cannot be nil") + (doseq arg args + (apply load-lib prefix (prependss arg opts)))) + :else + (throw (IllegalArgumentException. + (format "not a libspec or prefix list: %s" + arg))))))) ;; Public --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---