If-then-else had to be invented
231–240 of 255 posts
Re: If-then-else had to be invented
#232Earlier quoted context omitted.
I would say that in every case there is a set of things (maybe with a single member) and a set of predicates (maybe with a single member), a mapping from the things to the predicates, and every mapping produces a true proposition. "Women and children were present" isn't saying the intersection of the women and children were present but that the things were women and children and they all were present. The rest of the…
The meaning of “and” in natural language predates the meaning of “and” used in logics and set theories. I’m not convinced that all semantics of “and” can be derived from set operations. 1) not every clause is a predicate and applying logical operators to a non-predicate makes very little sense to me. 2) I don’t see how ordering, time, and causation can be inferred, if you treat each clause as a predicate. “I punched…
Yes and it's usually very hard to summarize what words can mean in different contexts, therefore it's usually harder to learn natural languages than programming languages. For example, in a programming language "while you're out, pick up some milk" would be an infinite loop. I think this is why Alexa, Google Assistant, Siri and many more are only finding usage for the simplest of tasks.
Re: If-then-else had to be invented
#233Earlier quoted context omitted.
I think for these purposes, “else” is different from the “or else” construction. As in: “Read thee the article, else thou shall suffer great ridicule in the comments.”
"thee" is the dative (and later accusative) inflected form of "thou", the second person singular pronoun. In your sentence above "Read" is the imperative form of the verb. The subject is elided since it's implicitly second person (singular or plural) (as imperative is used to give orders to people you're talking to) and if it wasn't elided it would have been in nominative case. Middle english had an ending -(e)th to…
Re: If-then-else had to be invented
#234Earlier quoted context omitted.
I think for these purposes, “else” is different from the “or else” construction. As in: “Read thee the article, else thou shall suffer great ridicule in the comments.”
(At least a couple of wrong words there: “thee” should be “thou”, and “shall” should be “shalt”. Also I reckon “thou shalt” reads much better as “shalt thou” in this style, though either is acceptable. Final proposed form: “Read thou the article, else shalt thou suffer great ridicule in the comments.” The overall style of the sentence is still rather off for the era, but it’ll do.)
Re: If-then-else had to be invented
#235I remember there was a paper that tried to compare natural language usage of common programming language keywords to see if they may come up with other constructs to create a programming language that is easier to learn as your first one. There were a few interesting observations. The one that stuck with me the most is that 'and' is most commonly used with almost the opposite sense in natural language vs programming:…
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.
"Do you like pizza, or?"
Depending on the exact statement, you might catch more or less flak.
Re: If-then-else had to be invented
#236Earlier quoted context omitted.
Unless you compile your program with movfuscator: https://github.com/xoreaxeaxeax/movfuscator Or you decide to execute code on The Fungus: https://www.bedroomlan.org/hardware/fungus I also recall reading a paper that got into implementing a GC on silicon for a graph rewriting based architecture WebAssembly is if/else blocks. There's a potential future where it gets implemented directly as a CPU ISA (albeit it'd likel…
> I also recall reading a paper that got into implementing a GC on silicon for a graph rewriting based architecture Maybe this one: https://github.com/tommythorn/Reduceron
Re: If-then-else had to be invented
#237Fun fact: English isn't my native language and I learned programming before becoming fluent in English. I believed for a long time that 'else' was just a shorter alternative for 'otherwise'. I used to say things like "I'll have apple juice if you've got some, else I'll have orange juice."
Re: If-then-else had to be invented
#238Earlier quoted context omitted.
> What is wrong with a yes response to "do you want to eat pizza or pasta?" It doesn't answer the question. The questioner is asking for your help in making a decision. If you are completely neutral about the two, then most people answer with the phrase, "Either one is fine". Saying just "yes" sounds like you misunderstood the question --- unless you say it with a wry smile, showing that you mean to be funny in your…
Completely off topic, but this is a pet peeve of mine: > > Similarly with the boy or girl question, "no" may be stillborn. > The sex is set at conception. Not necessarily - at conception, the cells could be XX, XY, but also XXY (not to mention, they could be X- or -Y). After conception, chymerism could occur, where XX and XY twins become conjoined and a single fetus develops having both XX and XY chromosomes in diffe…
Re: If-then-else had to be invented
#239Referring to the three-way “FORTRAN” syntax, you say, “The three-way "if" was more powerful than just checking for a negative, but was probably more confusing,” this is not right. As a 15-year-old at Stuyvesant, in 1966, learning FORTRAN 4, I assure you it was the most natural thing in the world. Especially instructive was the fact that usually two of the target statement numbers would be the same. FORTRAN 4 didn’t h…
Re: If-then-else had to be invented
#240I would love to read something similar about a "for" loop. "if/else" always sounded natural to me, but a "for" to mean a loop never did.