There are a number of tickets concerned with the fact that the set functions in clojure.set misbehave when passed arguments that are not sets.
This set of issues include CLJ-810, CLJ-1087, CLJ-1682, and CLJ-1954
The functions affected by this are:
as these are known to produce unexpected results when passed non-set arguments.
As the above mentioned issues suggest, todays implementation of these functions leads to confusion and erroneous results when called with non-set input. The user is given no warning or indications of the error he's making.
Add a coercion to set on the arguments said functions
Throw an exception when the arguments are not sets
Handle this with clojure.spec
Leave it as is
Given CLJ-2362, which makes a call to set close to a noop, the coercion should not incur much of a performance penalty. It has been argued that the code might even be faster, as type hints can be given and the compiler/jit might make better choices. For the common mistakes (passing vectors/lists instead of sets) it should be backwards compatible
Throwing an exception on non-set arguments would break programs which work correctly today (although by chance), such as data.diff.
Handling it with clojure.spec seems like a viable option, but again, this would break data.diff if the functions were spec'ed to both receive and return sets.
Leaving it as it is, and we will continue to surprise both new and old clojurists.
Evidence of this being a problem
The tickets mentioned above seem to indicate that people stumble upon this often enough to file issues