This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-29
Channels
- # announcements (2)
- # babashka (2)
- # beginners (76)
- # boot (6)
- # calva (7)
- # cider (12)
- # clara (4)
- # clj-kondo (11)
- # cljdoc (9)
- # cljs-dev (21)
- # cljsrn (7)
- # clojure (72)
- # clojure-dev (158)
- # clojure-europe (2)
- # clojure-italy (3)
- # clojure-losangeles (3)
- # clojure-nl (5)
- # clojure-spec (29)
- # clojure-uk (93)
- # clojurescript (40)
- # cursive (7)
- # data-science (1)
- # datomic (28)
- # defnpodcast (5)
- # duct (5)
- # emacs (7)
- # events (2)
- # figwheel-main (5)
- # fulcro (55)
- # graalvm (2)
- # instaparse (1)
- # jobs (5)
- # juxt (1)
- # luminus (3)
- # nyc (2)
- # pathom (3)
- # planck (25)
- # re-frame (2)
- # reagent (4)
- # reitit (23)
- # shadow-cljs (381)
- # spacemacs (6)
- # sql (19)
- # tools-deps (7)
- # xtdb (4)
Looking at spectrum, I can't figure out how to use it: https://github.com/arohner/spectrum I know it's (still) not recommended for any kind of use, but I was curious about what it can do. However, I don't even know what kind of output can I expect from it. Trying the most basic example doesn't produce anything useful:
(defn foo [i]
(inc i))
(f/infer-var #'foo)
;;=> couldn't find analysis for #'clojure-experiments.spectrum/foo
;; throws AssertionError
#_(f/infer-form '(foo 3))
Using spectrum 0.2.5; code is here: https://github.com/jumarko/clojure-experiments/blob/master/src/clojure_experiments/spectrum.clj#L11as far as I know it’s still all in development and not usable yet
I'm digging into it now, but does anyone have a guess as to what might be causing this?
user=> (require '[clojure.tools.logging :as log])
Syntax error macroexpanding clojure.core/defn at (clojure/tools/logging/impl.clj:241:1).
THIS - failed: vector? at: [:fn-tail :arity-1 :params] spec: :clojure.core.specs.alpha/param-list
THIS - failed: (or (nil? %) (sequential? %)) at: [:fn-tail :arity-n :bodies] spec: :clojure.core.specs.alpha/params+body
The line of code referenced above: https://github.com/clojure/tools.logging/blob/tools.logging-0.5.0/src/main/clojure/clojure/tools/logging/impl.clj#L241@ataggart Most likely an older version of clojure.tools.logging from before Clojure 1.9 was released, that contains some old syntax that Clojure 1.9's and later's stricter checking rejects, and someone has since fixed with a later tools.logging release.
Sorry, I was going for an answer appropriate for 99% of similar questions. Looking at the line of code now...
(! 775)-> clojure -Sdeps '{:deps {org.clojure/tools.logging {:mvn/version "0.5.0"}}}'
Clojure 1.10.1
user=> (require '[clojure.tools.logging :as log])
nil
user=>
Something in your environment @ataggart?(and I did wonder if a version conflict was bringing in an older version)
FWIW, we use tools.logging 0.5.0 at work with Clojure 1.10.1 -- which includes all the Spec checking on defn
-- and we don't see any problems.
What other dependencies have you got in play?
Yep, I'm confident it's a deps issue. I'll keep digging. Aside, any guess on what that error means?
It's a badly formed defn
. Expecting an argument vector or sequence of pairs of arg vectors / bodies.
It mentions param-list
, so my first guess would be it thinks the defn parameter list is not a vector
Are you using lein/boot/clj? What does your deps tree show? Could it be a badly-behaved plugin patching stuff?
So, I changed the version to 0.4.1, same error. Changed it back to 0.5.0, and the error is gone....
Please keep your gremlins away from my computer.
maybe a cached classpath? changing the deps file would invalidate the cache
so any change would have forced an update
if you're ever not sure with clojure
, adding an -Sforce can force that regardless