dom-top
dom-top copied to clipboard
clj-kondo hook for `loopr`
There's a clj-kondo analyze-call hook I created for your excellent loopr macro, here.
Apparently libraries can export clj-kondo configs, but unfortunately I don't have the time to wrap this up in a nice PR right now.
Indeed very useful library. I found an unexpected scenario that might be suitable for a clj-kondo check maybe.
In the example below shadowing m leads to unexpected result. I would expect that the shadowing would not affect the "for"-like binding part. So if the below is not a bug, maybe clj-kondo could help.
(let [m {:a 1}]
(loopr [m {}]
[[k v] m]
(recur (assoc m k v)))) ;=> {}
(let [m {:a 1}]
(loopr [m0 {}]
[[k v] m]
(recur (assoc m0 k v)))) ;=> {:a 1}