This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-02
Channels
- # announcements (34)
- # babashka (19)
- # beginners (106)
- # calva (50)
- # cider (25)
- # clj-commons (39)
- # clj-kondo (16)
- # clojure (59)
- # clojure-czech (3)
- # clojure-europe (33)
- # clojure-norway (9)
- # clojure-seattle (1)
- # clojure-sweden (1)
- # clojure-uk (2)
- # clojured (28)
- # clojuredesign-podcast (1)
- # clojurescript (7)
- # code-reviews (19)
- # conjure (15)
- # cursive (3)
- # datomic (3)
- # emacs (21)
- # etaoin (28)
- # graphql (4)
- # introduce-yourself (1)
- # joyride (2)
- # kaocha (2)
- # london-clojurians (8)
- # lsp (24)
- # music (4)
- # nbb (4)
- # nextjournal (1)
- # off-topic (13)
- # other-languages (16)
- # remote-jobs (1)
- # rewrite-clj (6)
- # sci (1)
- # shadow-cljs (40)
- # tools-deps (15)
it seems like kond doesn't understand how recur works inside a deftype/defrecord inline protocol extension or interface implementation. when you recur in those you don't pass the this
argument, which kondo flags as an error
I don't see any existing issues on github for this, but describing it in a search term is tricky
@U0NCTKEV8 Can you make an example of this?
(defprotocol CountDown
(count-down [_ n]))
(count-down
(reify CountDown
(count-down [_ n] (if (zero? n) :done (recur (dec n)))))
5)
Hmm, this works:
(defprotocol IFoo (-foo [_]))
(defrecord Foo [] IFoo (-foo [x] (recur x)))
user=> (defprotocol IFoo (-foo [_]))
(defrecord Foo [] IFoo (-foo [x] (recur x)))
IFoo
user=> Syntax error (IllegalArgumentException) compiling recur at (REPL:1:34).
Mismatched argument count to recur, expected: 0 args, got: 1
user=>
`