This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-01
Channels
- # announcements (23)
- # babashka (66)
- # babashka-sci-dev (7)
- # beginners (24)
- # biff (2)
- # calva (19)
- # cider (10)
- # clj-kondo (12)
- # cljs-dev (3)
- # cljsrn (2)
- # clojure (37)
- # clojure-art (1)
- # clojure-europe (50)
- # clojure-gamedev (1)
- # clojure-nl (1)
- # clojure-norway (22)
- # clojure-uk (7)
- # clojurescript (6)
- # conjure (28)
- # cursive (19)
- # data-science (11)
- # fulcro (21)
- # holy-lambda (12)
- # honeysql (6)
- # hyperfiddle (2)
- # jobs (1)
- # lsp (5)
- # malli (4)
- # meander (3)
- # missionary (8)
- # nbb (5)
- # off-topic (39)
- # rdf (9)
- # reitit (1)
- # releases (1)
- # sci (21)
- # shadow-cljs (42)
- # specter (1)
- # xtdb (11)
I'm getting this error. I'm using vscode
Unresolved namespace System. Are you missing a require?clj-kondo(unresolved-namespace)
@nsakib.cse Need more info please. Your code and file extension. I.e. a repro.
https://github.com/starain31/hello-deps-edn I try to create a sample. Here I got the error in .cljc
file but not in .clj
file. I don't know the difference of those file type. @borkdude
@nsakib.cse This is expected since .cljc
files are usually used for both Clojure and ClojureScript and System
is not a known thing in ClojureScript. You can solve this by writing:
#?(:clj (System/...))
If I solve by this way
(defn exit
[status]
#?(:clj (System/exit status)))
I get another warning
unused binding status clj-kondo(unused-binding)
I could get away from all warning by adding reader conditionals to the defn
#?(:clj (defn exit
"Exit the process with `status` and show `msg`."
[status]
(System/exit status)))
I'm calling this function from a babashka task
{:paths ["script"]
:min-bb-version "0.7.0"
:tasks
{pre-push {:extra-paths ["test"]
:requires ([pre-push])
:task (pre-push/main *command-line-args*)}}}
Which technique is correct or preferable?@nsakib.cse Good. Yes, sometimes this can be a bit annoying, but sometimes it can also be helpful to see that you forgot to use a binding in one branch