This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-30
Channels
- # aleph (39)
- # announcements (5)
- # babashka (7)
- # beginners (14)
- # biff (1)
- # clj-kondo (7)
- # clojure (38)
- # clojure-chicago (3)
- # clojure-europe (3)
- # clojure-norway (1)
- # clojurescript (8)
- # cursive (17)
- # data-science (6)
- # defnpodcast (3)
- # emacs (4)
- # figwheel-main (1)
- # honeysql (2)
- # hyperfiddle (2)
- # malli (20)
- # missionary (24)
- # off-topic (27)
- # reagent (4)
- # scittle (11)
- # shadow-cljs (51)
- # spacemacs (1)
- # xtdb (2)
clojure.core/defn-
[name & decls]
same as defn, yielding non-public def
Why does :varargs-min-arity
differ for defn-
in the usage and definition analysis?;; definition
{:ns clojure.core
:name defn-
:doc "same as defn, yielding non-public def"
:varargs-min-arity 1
:arglist-strs ["[name & decls]"]}
;; usage
{:name defn-,
:filename "/tmp/foo.clj",
:from foo,
:macro true,
:col 2,
:arity 3,
:varargs-min-arity 2,
:row 8,
:to clojure.core}
That's weird, but perhaps you can figure it out on kondo's source and report an issue about it?
Yes, I can take a stab at that. I thought perhaps it's the correct result and I just misunderstood something, but if you concur that it's unusual, I'll take a look at the source and put some details in an issue.
I think I understand the cause. It looks like overrides are not being applied to definitions, so the expected :varargs-min-arity 1
is reported for [name & decls]
, but for usages the overrides set :varargs-min-arity 2
https://github.com/clj-kondo/clj-kondo/blob/master/src/clj_kondo/impl/overrides.clj#L22-L25
Tried to fix it but couldn't get to the bottom of it. I left some details https://github.com/clj-kondo/clj-kondo/issues/1758. Thanks! 🙏