If-then-else had to be invented
51–60 of 255 posts
Re: If-then-else had to be invented
#52Good work digging through these historic esoteric languages. Wikipedia states McCarthy of Lisp fame invented it so many of the evangelists here likely know the conclusion here.
Re: If-then-else had to be invented
#53Ah, interesting, I wish the title had been prefixed with "What if ". There's a language where THEN basically means ENDIF... Forth, if memory serves me right?
I think the tactic strategy to achieve this is to confine conditional branches in a few well chosen words.
For instance if you have a word SORT that sorts the top pair on the stack, which has to have a branch:
: SORT 2DUP
then you can build "if-less" MIN, MAX and ABS: : MIN SORT NIP ;
: MAX SORT DROP ;
: ABS 0 SORT SWAP - ;Re: If-then-else had to be invented
#54"Else" is not archaic. Every kid growing up in the sixties knew that the way to start a fight was to say "Or else!" It was used a lot in cowboy movies before a gunfight.
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.”
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 form a plural second person imperative.
"Learn the grammar of past and present languages, else you'll attract pedants from the intertubes"
Re: If-then-else had to be invented
#55I guess the unknown German word mentioned in the post is probably "sonst". It can be translated to "otherwise" or "else". And "wenn...dann...sonst" sounds perfectly natural in German.
Willing to bet it's either "sonst" or "andernfalls"... I'd suspect the latter, the former is a little bit too informal for mathematicians. Both of these are commonly used for case enumerations in math.
Re: If-then-else had to be invented
#56Earlier quoted context omitted.
> But the "or" makes the meaning ambiguous I disagree that or is ambiguous. In English we use or to mean xor, that is one item or the other item but not both. If we want to clarify that choosing both items is an option we use the term and/or.
> I disagree that or is ambiguous There are examples of inclusive “or” in natural language. When the waiter asks: “Would you like cream or sugar?”, it’s not meant to imply that you should pick only one; it’s fine to answer “both” (example from: https://divisbyzero.com/2009/09/27/is-or-an-inclusive-or-or-... ).
This is a large part of why I dislike prescribed Oxford comma, because it undermines this legitimate use of a comma to alter the semantics.
Re: If-then-else had to be invented
#57"Else" is not archaic. Every kid growing up in the sixties knew that the way to start a fight was to say "Or else!" It was used a lot in cowboy movies before a gunfight.
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.”
Re: If-then-else had to be invented
#58I 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:…
The word “and” in English is simply there to join multiple clauses together. Whether it is a set union or set intersection, (or some other relations) depends on the sentence. Set union: they can read and write’ Set intersection: my jeans were creased and dirty Sequential: he turned round and walked out Causal: there was a flash flood and by the next morning the town was under water’ And, there are many more usages.
Re: If-then-else had to be invented
#59Earlier quoted context omitted.
Wiktionary has a usage example from 1903, clearly before modern computers but not too ancient. > 1903, Jack London, The Call of the Wild, Grosset & Dunlap, page 44: > […] and his first experience taught him an unforgetable lesson. It is true, it was a vicarious experience, else he would not have lived to profit by it. As an aside there is at least one common word which does seem to have been invented by the software…
I believe that sentence should read “or else he would have...” to be grammatically correct.
Re: If-then-else had to be invented
#60"Else" is not archaic. Every kid growing up in the sixties knew that the way to start a fight was to say "Or else!" It was used a lot in cowboy movies before a gunfight.
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.”