Hacker News new | past | comments | ask | show | jobs | submit login

Constantly wondering if people mean `or' or `xor' (I mean xor)



"Lunch specials include salad or fries"

"Great, I'll have both!"


Related: when people ask me if I'd like "A or B" I wonder if people mean "A || B", to which I'd reply with true/false, or "max(A, B)", to which I'd reply with A (if I have higher preference for A) or B (if I have higher preference for B).

Here are two unambiguous examples:

"Are you a US citizen or permanent resident? Yes [ ] No [ ]"

versus:

"Would you like coffee or tea?"

In some settings, when they ask "A or B", it's hard to know which of the following set are valid answers: {{}, {A}, {B}, {A,B}}


I find it's most often people say "or" when they mean xor, and "and/or" when they mean or.

So perhaps we should start saying either "or" or "ior" (inexclusive or).


The "and/or" thing actually sort of makes sense if you take "or" to mean "xor", since (A XOR B) OR (A AND B) equals (A OR B)


So, slash is really 'or'?

Oh, my head.


    english   logic
    -------   -----
    and       AND
    or        XOR
    /         OR
Actually, since (A XOR B) and (A AND B) are mutually exclusive, (A XOR B) XOR (A AND B) also equals (A OR B), so "/" could be "XOR" too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: