This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-10
Channels
- # announcements (1)
- # babashka (16)
- # beginners (42)
- # calva (6)
- # clj-kondo (7)
- # clj-yaml (13)
- # cljdoc (7)
- # clojure (34)
- # clojure-bay-area (7)
- # clojure-dev (14)
- # clojure-europe (10)
- # clojure-nl (1)
- # clojure-norway (26)
- # clojure-sweden (91)
- # clojurescript (7)
- # datalevin (3)
- # datomic (35)
- # dev-tooling (8)
- # emacs (22)
- # graphql (1)
- # honeysql (13)
- # hyperfiddle (28)
- # introduce-yourself (1)
- # jobs-discuss (11)
- # juxt (4)
- # lsp (21)
- # off-topic (7)
- # reagent (4)
- # releases (3)
- # spacemacs (16)
- # xtdb (4)
- # yamlscript (2)
beginner question:
When I tried to change a var in some library, for example (alter-var-root #'cheshire.parse/*use-bigdecimals?* (constantly true))
clj-kondo complains Unresolved namespace cheshire.parse. Are you missing a require?
.
Do I actully need to add a require cheshire.parse
to suppress the warning, or is this just a false positive warning to ignore?
If I just create a new empty ns without any require and run the code , it just runs and changes the global var from that library. Is this expected?
you can use qualified vars without requiring the namespace but only if the corresponding namespace was loaded (for example requered transitively). but it is always better to be explicit and require in the namespace that uses that var
Thanks for the explanation. I do have a http client which has a {:as :json} which requires cheshire transitively I guess. Is there a way to list all namespaces being required transitively so I can verify this case?
You can use :verbose
with require https://clojuredocs.org/clojure.core/require