lua-users home
lua-l archive

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


On 16 December 2014 at 18:03, Andrew Starks <andrew.starks@trms.com> wrote:
Perhaps this is really off base, but `and`, `or` and `not` are all
"naked" and allowed.

Perhaps you could use these keywords as examples, by explaining how
that case is different?

-Andrew

'goto' is a control structure, similar to 'if', 'do', 'return', 'while', etc.
Lua made the choice that control flow keywords are not valid in an _expression_.

logical 'and' and 'or' are in a bit of a different category as short circuit boolean infix operators.
They have to be expressions; but evaluating both sides is a waste, 
the cognitive load is low, as short circuiting boolean operators is the behaviour in all languages I know of.