-
Notifications
You must be signed in to change notification settings - Fork 6
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
the name 'xor' can be misleading #18
Comments
this is a good criticism. one thing it's not too late to do is make an alias and deprecate the old name. Not sure how I feel about |
Let's not optimize prematurely for concision :) (not until experience shows people use it a lot, at which point we can always think of a shorter alias) That be said, I can suggest |
I just remembered that it should be fine to break things as long as clojure.spec is still breaking things. So I'll just rename it. |
I'd read How about |
I think the term 'one-hot' (from logic design) might best represent the intent. See https://en.wikipedia.org/wiki/One-hot for the background. |
Small nitpick on the 'xor' name:
In this library, the semantics of
xor
is "matches exactly one spec".However, the commonly accepted meaning of the XOR operator (in math and CompSci) is boolean addition, which actually means "an odd number of those are true" (not "exactly one of those is true", except for the 2-arity case of course).
I think
one-of
would be a better name. If it's too late, maybe document it?The text was updated successfully, but these errors were encountered: