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

AlexBaranosky opened this Issue Dec 26, 2012 · 5 comments


None yet
3 participants

AlexBaranosky commented Dec 26, 2012

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


technomancy commented Dec 26, 2012

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


AlexBaranosky commented Dec 26, 2012

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...


technomancy commented Dec 26, 2012

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.


AlexBaranosky commented Jan 3, 2013

This code seems to work: #24


guns commented Sep 21, 2013

Fixed by #24

guns closed this Sep 21, 2013

@guns guns added a commit to guns/slamhound that referenced this issue Nov 3, 2013

@guns guns Change disambugating predicates to return numbers
Issue #22 and commit 835a671 describe
a preference of directly referred vars over implicitly referred vars
through :use or :refer :all.

In order to implement this we change the disambiguating predicates to
return numbers instead of bools. This allows expression of non-binary
preferences, which may also be useful in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment