予約語
Luaの制御構文に使われるキーワードのことで、以下の21個。 code:予約語
and break do else elseif
end false for function if
in local nil not or
repeat return then true until while
Luaは大文字/小文字を区別するような言語であるため、例えばAndやANDは予約語ではない。
例
code:Lua
-- local and=123 -- エラー
local And=456
local AND=789
-- print(and) -- エラー
print(And)
print(AND)
if(And==456 and AND==789)then -- このように and は適切な用途でのみ使える
print("!")
end