lua-users home
lua-l archive

Re: Why is "then" required in the if statement?

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


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

AltStyle によって変換されたページ (->オリジナル) /