Lua

Lua: Basics

Identifiers

Identifiers can be any string or letters, digits, and underscores, but they can not being with a digit.

Identifiers starting with an underscore and followed by upper-case letters are reserved by Lua.

The underscore by itself, by convention, is used as a dummy variable.

Reserved words

and    break   do      else      elseif 
end    false   for     function  goto
if     in      local   nil       not
or     repeat  return  then      true
until  while

Case sensitivity

Lua is case sensitive.

Comments

Comments begin with --, can start anywhere on a line, and run until the end of the line.

Multi-line comments start with --[[ and run until the first ]].

-- Single line comment

print("Hello") -- another single line comment

--[[
This is an 
example of a
multi-line comment
]]

Tools

Web

Languages

Data