dscarpetti/codax

Error after :require codax

Closed this issue · 5 comments

Any idea how to fix this? I really want to use it. 😰
clojure.lang.Compiler$CompilerException: clojure.lang.ExceptionInfo: Call to clojure.core/defn did not conform to spec: In: [0] val: codax.pathwise/encode-element fails spec: :clojure.core.specs.alpha/defn-args at: [:args :name] predicate: simple-symbol? :clojure.spec.alpha/args (codax.pathwise/encode-element [el65854] (clojure.core/cond (true? el65854) (clojure.core/str (clojure.core/char 33) ((fn [_] "") el65854) codax.pathwise/+delim+) (date-time? el65854) (clojure.core/str (clojure.core/char 36) (encode-date-time el65854) codax.pathwise/+delim+) (neg-infinity? el65854) (clojure.core/str (clojure.core/char 48) ((fn [_] "") el65854) codax.pathwise/+delim+) (pos-infinity? el65854) (clojure.core/str (clojure.core/char 50) ((fn [_] "") el65854) codax.pathwise/+delim+) (number? el65854) (clojure.core/str (clojure.core/char 49) (encode-number el65854) codax.pathwise/+delim+) (symbol? el65854) (clojure.core/str (clojure.core/char 104) (encode-symbol el65854) codax.pathwise/+delim+) (false? el65854) (clojure.core/str (clojure.core/char 32) ((fn [_] "") el65854) codax.pathwise/+delim+) (string? el65854) (clojure.core/str (clojure.core/char 112) (encode-string el65854) codax.pathwise/+delim+) ((fn* [p1__65853#] (or (vector? p1__65853#) (list? p1__65853#))) el65854) (clojure.core/str (clojure.core/char 160) (encode-vector el65854) codax.pathwise/+delim+) (keyword? el65854) (clojure.core/str (clojure.core/char 105) (encode-keyword el65854) codax.pathwise/+delim+) (nil? el65854) (clojure.core/str (clojure.core/char 16) ((fn [_] "") el65854) codax.pathwise/+delim+) :else (throw (java.lang.Exception. (clojure.core/str "no method for encoding " el65854 ""))))) {:clojure.spec.alpha/problems [{:path [:args :name], :pred simple-symbol?, :val codax.pathwise/encode-element, :via [:clojure.core.specs.alpha/defn-args :clojure.core.specs.alpha/defn-args], :in [0]}], :clojure.spec.alpha/args (codax.pathwise/encode-element [el65854] (clojure.core/cond (true? el65854) (clojure.core/str (clojure.core/char 33) ((fn [_] "") el65854) codax.pathwise/+delim+) (date-time? el65854) (clojure.core/str (clojure.core/char 36) (encode-date-time el65854) codax.pathwise/+delim+) (neg-infinity? el65854) (clojure.core/str (clojure.core/char 48) ((fn [_] "") el65854) codax.pathwise/+delim+) (pos-infinity? el65854) (clojure.core/str (clojure.core/char 50) ((fn [_] "") el65854) codax.pathwise/+delim+) (number? el65854) (clojure.core/str (clojure.core/char 49) (encode-number el65854) codax.pathwise/+delim+) (symbol? el65854) (clojure.core/str (clojure.core/char 104) (encode-symbol el65854) codax.pathwise/+delim+) (false? el65854) (clojure.core/str (clojure.core/char 32) ((fn [_] "") el65854) codax.pathwise/+delim+) (string? el65854) (clojure.core/str (clojure.core/char 112) (encode-string el65854) codax.pathwise/+delim+) ((fn* [p1__65853#] (or (vector? p1__65853#) (list? p1__65853#))) el65854) (clojure.core/str (clojure.core/char 160) (encode-vector el65854) codax.pathwise/+delim+) (keyword? el65854) (clojure.core/str (clojure.core/char 105) (encode-keyword el65854) codax.pathwise/+delim+) (nil? el65854) (clojure.core/str (clojure.core/char 16) ((fn [_] "") el65854) codax.pathwise/+delim+) :else (throw (java.lang.Exception. (clojure.core/str "no method for encoding " el65854 "")))))}, compiling:(codax/pathwise.clj:108:1)

Just ran into the same one. It's the symbols in the two defns in the macro in that file. They are encode-element and decode-element instead of ~'encode-element and ~'decode-element which means they get fully qualified when expanded. Which means they fail the simple-symbol? predicate in the spec for defn.

Pretty damn subtle one. Got a patch coming soon as I totally test it out, but that seems to be the only issue.

Thank you for the quick fix. I hadn't run the code with 1.9, so this has long gone unnoticed!

Has this been pushed to Clojars? I'm not seeing the fix yet, but wondering if it's in the pipe.

Pushed now.

Thank you!