This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-09
Channels
- # announcements (12)
- # beginners (159)
- # boot (3)
- # calva (41)
- # cider (48)
- # clara (2)
- # clj-kondo (8)
- # cljdoc (8)
- # clojure (70)
- # clojure-dev (10)
- # clojure-europe (2)
- # clojure-losangeles (1)
- # clojure-nl (12)
- # clojure-spec (7)
- # clojure-uk (63)
- # clojurescript (24)
- # cursive (24)
- # datomic (22)
- # expound (17)
- # figwheel (1)
- # fulcro (176)
- # graphql (23)
- # jobs (9)
- # jobs-discuss (56)
- # kaocha (1)
- # mount (3)
- # nyc (1)
- # off-topic (91)
- # onyx (3)
- # overtone (4)
- # pathom (3)
- # pedestal (1)
- # re-frame (11)
- # reitit (19)
- # ring (8)
- # shadow-cljs (16)
- # test-check (5)
- # testing (2)
- # tools-deps (20)
- # vim (9)
hi everyone, I'm getting
Caused by java.lang.RuntimeException
Unable to resolve symbol: STATE__ in this context
while trying to eval defn with #light
tagcider trace
Util.java: 221 clojure.lang.Util/runtimeException
Compiler.java: 7414 clojure.lang.Compiler/resolveIn
Compiler.java: 7358 clojure.lang.Compiler/resolve
Compiler.java: 7319 clojure.lang.Compiler/analyzeSymbol
Compiler.java: 6768 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 3881 clojure.lang.Compiler$InvokeExpr/parse
Compiler.java: 7109 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 3888 clojure.lang.Compiler$InvokeExpr/parse
Compiler.java: 7109 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 3888 clojure.lang.Compiler$InvokeExpr/parse
Compiler.java: 7109 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 6118 clojure.lang.Compiler$BodyExpr$Parser/parse
Compiler.java: 7107 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 6120 clojure.lang.Compiler$BodyExpr$Parser/parse
Compiler.java: 5467 clojure.lang.Compiler$FnMethod/parse
Compiler.java: 4029 clojure.lang.Compiler$FnExpr/parse
Compiler.java: 7105 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 38 clojure.lang.Compiler/access$300
Compiler.java: 596 clojure.lang.Compiler$DefExpr$Parser/parse
Compiler.java: 7107 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 7181 clojure.lang.Compiler/eval
Compiler.java: 7132 clojure.lang.Compiler/eval
core.clj: 3214 clojure.core/eval
core.clj: 3210 clojure.core/eval
debug.clj: 584 cider.nrepl.middleware.debug/instrument-and-eval
debug.clj: 579 cider.nrepl.middleware.debug/instrument-and-eval
Var.java: 384 clojure.lang.Var/invoke
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 437 clojure.main/repl/read-eval-print
main.clj: 458 clojure.main/repl/fn
main.clj: 458 clojure.main/repl
main.clj: 368 clojure.main/repl
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 665 clojure.core/apply
core.clj: 660 clojure.core/apply
regrow.clj: 18 refactor-nrepl.ns.slam.hound.regrow/wrap-clojure-repl/fn
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 79 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 55 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 142 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 171 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 170 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 745 java.lang.Thread/run
@fmnoise Seems like you’ve encountered a bug. File a report with CIDER or cider-nrepl.
Not sure where to discuss this, but since @bozhidar is around here:
I think this style guide rule is a bit ambiguous.
https://github.com/bbatsov/clojure-style-guide#else-keyword-in-cond
Should I read that as: always use :else
in cond, or only when you intend the last clause as a catch-call?
so:
(cond (< x 5) .. (< x 10) ..)
returns nil
for (=> x 11)
, that doesn’t require an :else
?@borkdude Yeah, I see what you mean. You should use :else
when you need a catch all. Depending on the conditions that’s not always necessary.
I think we discussed something similar with you and @alexmiller recently on Twitter.
For cond
having an :else
in definitely necessary in some scenarios as if you don’t have any matches it returns nil
, which is not exactly great.
some people are relying on nil
so I wasn’t sure about this.
right now clj-kondo complains every time you have no :else
. I haven’t had any complaints from users so far.
but after this conversation I made this issue: https://github.com/borkdude/clj-kondo/issues/147
I think the rule should be looking for other truthy values which should instead be :else
that’s indeed what this conversation is about and since I’ve heard both opinions, it’s probably going to be configurable
I'd like the linter to fail when someone does 1 or something though, I don't think the default should encourage the including of :else nil
I’m inclined to make that the default, since it leads to less false positives without any config
Well, some times nil
might be ok, but I definitely think that some explicit return value would be better most of the time.
I guess you can make this configurable and keep the current behaviour as the default.
now the classic: where do you configure? Source comment. project file, global settings, etc
I don’t like changing the source code because of a linter, so I’m inclined in a project .clj-kondo/config.edn file
That’s how I do it in RuboCop (https://github.com/rubocop-hq/rubocop) and it has worked out really well.
Most linters support some default file in the home folder and per project configuration.
Here's an example global configuration file:
nrepl/nrepl.edn
that should read .nrepl/nrepl.edn
yes?Basically I just get if there’s global config map and merge it with a project config map if present. Works out really well in practice.
yeah. what I’m having right now is that you have a project config in .clj-kondo/config.edn
and you can override it with a CLI argument --config
which accepts either a file path or a literal EDN expression
maybe I should also name the config.edn
clj-kondo.edn
, but that would be a breaking change…
on an unrelated, but more on topic note. I’ve been using Java 11 for a while. when I start my project I see this:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval2845$fn__2846 to method java.net.URLClassLoader.addURL(java.net.URL)
On a fresh install of ubuntu and emacs prelude I'm getting user-error: The clojure executable isn’t on your ‘exec-path’
and user-error: The lein executable isn’t on your ‘exec-path’
when I try to cider-jack-in
. I do have both installed. How do I debug this?
$ which lein
/usr/bin/lein
$ which clojure
/usr/local/bin/clojure
(describe-variable 'exec-path)
=>
Its value is
("/app/bin/" "/usr/bin/" "/app/libexec/emacs/26.2/x86_64-pc-linux-gnu/" "/usr/local/bin/")
Original value was
("/app/bin" "/usr/bin" "/app/libexec/emacs/26.2/x86_64-pc-linux-gnu")
Thanks! Now that I know what the problem is I'll look for that package (and install from source if I can't find and use it easily ¯\(ツ)/¯).
Has anybody ever looked into this for Clojure/ClojureScript? https://github.com/emacs-lsp/dap-mode