technomancy/slamhound

clojure.set/join getting chosen over clojure.string/join

AlexBaranosky opened this issue · 5 comments

If a namespace uses clojure.string/join, but also includes clojure.set, it seems to always choose set/join over string/join.

This is for :refer rather than :as, right?

yes, for :refer. It sees both as being present in the original ns, so it then choose by alphabetical sort (I think). 99% of the time you want clojure.string/join. I've actually yet to use clojure.set/join...

We should probably get it to prefer :as candidates when the last segment of the ns matches the alias used, but that doesn't help for :refer.

I don't think it's feasible to get in the business of maintaining a preferences list just because the scope of such a thing would potentially be almost limitless.

We could possibly search for user-specified preference rules, but the implementation of that could get hairy. Maybe if it were just read-string on a dotfile? Even then supporting project-level rules vs user-wide ones could be tricky.

This code seems to work: #24

guns commented

Fixed by #24