lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Am 09.09.2013 02:27, schrieb Michael Richter:
On 9 September 2013 05:22, Seppl Vorderhörer <Seppl.Vorderhoerer@t-online.de> wrote:
The confusing thing is that "and" is used in a way that is simply not intuitive but quite the opposite. While "or" is a selection that can easily be viewed as "use A or B" (which fits what is actually happening in Lua) the word "and" has a different meaning in life: "A and B" simply means "use both A and B".

You are arguing about a piece of mathematical logic (which is what a computer programming language is, or at least should be) by referring to usage in natural language.  This is not an argument that bears scrutiny for longer than five seconds.  Think, carefully, about what else would have to change to make things match natural language.  (Hint: "for" and "while" aren't used intuitively either.  Nor is "or".  Nor is "do".  Nor is "if" for that matter.)  Then maybe you'll stop going down this ridiculous path.

Instead of whining about how X isn't like natural language N, learn X.



Well... let's for the moment put aside the unpolite and insulting tone of your email.

"for" is used in Lua in two forms:
    for var=start,end,inc do something

... which is pretty close to a native language: run through all values from start to end.

Same applies to
    for a,b in pairs(c) do something

The same applies to "while" or "do": "While something is the case do something else" is a nice construct even containing both keywords and at least from my point of view they are not used too far from their meaning in English.

I even dare to say that the creators of programming languages usually choose keywords to have meanings that to some extent coincide with or come close to their meanings in natural languages.

Also "or" has a meaning in Lua, that comes somewhat close to the meaning of "or" in natural languages: Something is either this or that (or both).

On top of that even "and" has a meaning in Lua which is the same as in English in a specific context. Something is true, if it's both a and b. The only (in my opinion) weird thing is to use "and" as a selector to convert "a and b" into the result "false" or "b" depending on "a".

This is only my opinion. You can have your own and we can discuss this or leave each other alone (which I will do from now on).

But there is no need for getting rude or unpolite.