Hi, does anyone have advice for how to read the following error message from plumatic/schema? My understanding is that the arity doesn't conform to spec but where did the error occur? (`(demo/data.clj:77:1)` is simply where I defined the function)
Error refreshing environment: Syntax error macroexpanding clojure.core/defn at (demo/data.clj:77:1).
Call to clojure.core/defn did not conform to spec. clojure.lang.ExceptionInfo: Call to clojure.core/defn did not conform to spec. #:clojure.spec.alpha{:problems ({:path [:fn-tail :arity-1 :params], :pred clojure.core/vector?, :val :-, :via [:clojure.core.specs.alpha/defn-args :clojure.core.specs.alpha/params+body :clojure.core.specs.alpha/param-list :clojure.core.specs.alpha/param-list], :in [1]} {:path [:fn-tail :arity-n :bodies], :pred (clojure.core/fn [%] (clojure.core/or (clojure.core/nil? %) (clojure.core/sequential? %))), :val :-, :via [:clojure.core.specs.alpha/defn-args :clojure.core.specs.alpha/params+body :clojure.core.specs.alpha/params+body], :in [1]}), :spec #object[clojure.spec.alpha$regex_spec_impl$reify__2509 0x406684fa "clojure.spec.alpha$regex_spec_impl$reify__2509@406684fa"], :value (ticker->parsed-fname :- s/Str [ctx :- tsk/KeyMap ticker :- s/Str] (with-map-vals ctx [localdate-from localdate-to] (format "%s/%s-parsed.edn" (config/eod-historical-data-dir localdate-from localdate-to) ticker))), :args (ticker->parsed-fname :- s/Str [ctx :- tsk/KeyMap ticker :- s/Str] (with-map-vals ctx [localdate-from localdate-to] (format "%s/%s-parsed.edn" (config/eod-historical-data-dir localdate-from localdate-to) ticker)))}
Maybe you could post the function itself
Sounds like a defn
that has :-
instead of an argument vector. I'm guessing you used defn
(from core) with Schema syntax instead of Schema's own variant of defn
? @ronny463
(based on :pred clojure.core/vector?, :val :-
in the first line of the exception)
that's exactly what happened, thank you 🙂