nathell / clj-tagsoup

A HTML parser for Clojure.
Other
180 stars 22 forks source link

Doesn't compile on Clojure 1.9.0-alpha12 #18

Open AdamFrey opened 7 years ago

AdamFrey commented 7 years ago

The new alpha releases of Clojure do compile-time checking for core macros like ns, defn

Trying to require clj-tagsoup on Clojure 1.9.0-alpha12 throws the following big error and shows that the problem is actually when it trying to require clojure/data/xml.clj

clojure.lang.Compiler$CompilerException: 
clojure.lang.ExceptionInfo: Call to clojure.core/defn did not conform to spec:
In: [1 0] val: ({:keys (attrs)} writer) fails spec: :clojure.core.specs/arg-list at: [:args :bs :arity-1 :args] predicate: (cat :args (* :clojure.core.specs/binding-form) :varargs (? (cat :amp #{(quote &)} :form :clojure.core.specs/binding-form))),  Extra input
In: [1 0] val: {:keys (attrs)} fails spec: :clojure.core.specs/arg-list at: [:args :bs :arity-n :bodies :args] predicate: vector?
:clojure.spec/args  (write-attributes [{:keys (attrs)} writer] (doseq [[k v] attrs] (if (namespace k) (.writeAttribute writer (str (namespace k)) (name k) (str v)) (.writeAttribute writer (name k) (str v))))) 
...
compiling:(clojure/data/xml.clj:30:1)

The version of clojure/data/xml that clj-tagsoup is using contains the broken code and is also quite old. Bumping the clojure/data/xml dependency should fix the problem.

nathell commented 7 years ago

Thanks for reporting this, I'll be fixing it in a few days.