[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why is "then" required in the if statement?
- From: Matt Campbell <mattcampbell@...>
- Date: Sat, 01 Dec 2007 14:45:50 -0600
if p < 8 p = 9 end
Seems unambiguous to me. In Lua, "p < 8" is an expression that's not a
function call, so it can't be a statement. Likewise, "p = 9" is an
assignment, so it can't be an expression. Moreover, Lua never allows
two expressions next to each other, except in the case of a function
call whose sole argument is a string literal or table constructor; in
that case, the second expression (the function argument) could not be
mistaken for a statement.
Matt