Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clj-kondo hook for loopr #4

Open
walterl opened this issue Sep 11, 2022 · 1 comment
Open

clj-kondo hook for loopr #4

walterl opened this issue Sep 11, 2022 · 1 comment

Comments

@walterl
Copy link

walterl commented Sep 11, 2022

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.

@jeroenvandijk
Copy link

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}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants