Earlier quoted context omitted.
If you say it out loud, you will realize that the question "Do you want to eat pizza or pasta?" (exclusive-or case with the answer "pizza" or "pasta," i.e. in the sense "these are your two choices, which would you prefer?") is an entirely different utterance from "Do you want to eat pizza or pasta?" (inclusive-or case with the answer "yes" or "no," i.e. in the sense "would you like to go to an Italian restaurant?").…
>inclusive-or case I used to drive my friend crazy when he would ask if I wanted a peanut butter and jelly sandwich or a ham and cheese sandwich and I would answer yes.
If-then-else had to be invented
171–180 of 255 posts
Re: If-then-else had to be invented
#172Earlier quoted context omitted.
How is your set union example not another intersection (your quantification could go in one of two places though, they = (set of readers) cap (set of writers) versus they = { p in people such that (p writes) cap (p reads) }.
> they can read and write Note that I’m not joining people with AND. I joined abilities. For instance, to expand on the example. I have three Pokémons. They can read and write. I’m not saying that my three Pokémon are the intersection of reading Pokémon and writing Pokémon. There might be other Pokémon who can do just the same. I’m saying that what they can do is a union of writing and reading. EDIT: spelling
Now, thanks to what I can only describe as the implicit vagaries of English, the bounding (three) might now imply that I have three ... or more Pokémons! To make that sentence precise: I have three Pokémons and they can read and write. Here I am substituting and for a full stop (period.) When I deployed "that" I managed to muddy the waters.
Mapping logical and Boolean operators to grammatical constructs is tricky and should not be taken lightly. Best to consider them separately. AND is not and (except when it is!)
Be careful out there kids.
Re: If-then-else had to be invented
#173Earlier quoted context omitted.
I am the author, and I mean that I can say "or else" in a normal sentence, but I cannot say "else" without an "or" in normal speech in my normal dialect.
Fascinating. English is not my first language but I thought https://en.wiktionary.org/wiki/what_else_is_new and https://www.ldoceonline.com/dictionary/what-else-can-somebod... are perfectly fine phrases.
Re: If-then-else had to be invented
#174Earlier quoted context omitted.
I am the author, and I mean that I can say "or else" in a normal sentence, but I cannot say "else" without an "or" in normal speech in my normal dialect.
Fascinating. English is not my first language but I thought https://en.wiktionary.org/wiki/what_else_is_new and https://www.ldoceonline.com/dictionary/what-else-can-somebod... are perfectly fine phrases.
Re: If-then-else had to be invented
#175Earlier quoted context omitted.
Great observations. In the same idea, "or" is inclusive in all of programming and CS, i.e. A and B => A or B, but in natural languages (as least the ones I know) "or" is almost always exclusive, i.e "do you want to eat pizza or pasta?" does not imply that eating both is an option. This is of course related to why the famous joke "Is it a boy or a girl? Yes." is so hilarious.
If you say it out loud, you will realize that the question "Do you want to eat pizza or pasta?" (exclusive-or case with the answer "pizza" or "pasta," i.e. in the sense "these are your two choices, which would you prefer?") is an entirely different utterance from "Do you want to eat pizza or pasta?" (inclusive-or case with the answer "yes" or "no," i.e. in the sense "would you like to go to an Italian restaurant?").…
Do you want to eat pizza or garlic bread? - exclusive
In natural language "and" works like a inclusive or. If there is pizza and garlic bread I can choose to eat one or both. Or is always exclusive in this sentence.
Re: If-then-else had to be invented
#176Earlier quoted context omitted.
To make things even worse, we sometimes capitalise these words to emphasise that we're using them in a technical sense, but OR reads as if it's emphasising that it's an exclusive 'or'. You can have tea OR coffee is clearly emphasising that it's an XOR operation. Somewhat related: the Ada language uses and , or , xor for its logical operators, but uses and then and or else for the short-circuit forms. [0] Not a very n…
VB.NET also uses “OrElse” and “AndAlso” for short-circuiting. VB6 didn’t support short-circuiting at all.
On second thought I was mistaken about the example I gave. If someone says You can have tea OR coffee they're really expressing a NAND. You can have at most one out of the two options. Unlike with XOR, you're permitted to have neither.
To express XOR, you'd need to say You must have tea or coffee.
Re: If-then-else had to be invented
#177Earlier quoted context omitted.
I am the author, and I mean that I can say "or else" in a normal sentence, but I cannot say "else" without an "or" in normal speech in my normal dialect.
Hmmm, thinking about my dialect of English (Lancastrian) I can certainly say else without an or and it doesn't sound unnatural to my ears. Something like "if you're hungry now then I can make you a sandwich, else we'll eat when we get to the pub" doesn't sound more awkward than using otherwise. I can't say whether that's just because the Lancastrian dialect preserves quite a few old fashioned usages that have fallen…
Re: If-then-else had to be invented
#178I remember over 5 years ago, they helped me me visualise 1 billion "Shazam's" (where I was working at the time) onto map tiles. Glad to see they are still supporting developers!
Re: If-then-else had to be invented
#179Earlier quoted context omitted.
You’ve framed it in the article and here again as a correctness issue, but it’s not a correctness issue. It’s fair to say you haven’t heard it, or that it’s uncommon today, but if you use it, it’s not wrong. And people will understand you, even if you do get a sideways glance from some people. You can use “else” without “or”, if you like. The article was fascinating, especially the historical examples from different…
I was a linguistics major in college and therefore am a descriptivist, not a prescriptivist about language. When I say I cannot say this, I mean that this construct does not exist in the ordinary dialect that I speak, in the same way that I can say "that doesn't need washed" even though speakers of many other dialects have to say "washing" instead. If it is in someone else's dialect, they can feel free to say it, but…
Agreed. And this is the reason why use of 'else' in programming languages might not have had to be invented, right?
Re: If-then-else had to be invented
#180Some example syntax:
unless name is 'Steve'
print 'Impostor!'
otherwise
print 'Steve'
“if” and “else” work, too. But I really did like the “unless” and “but” keywords.