Module:Hello World

--copied from https://en.wikipedia.org/wiki/Help:Lua_for_beginners

local p = {} -- Defines a variable p as an empty table, but *not* nil.

function p.main( frame ) -- This block defines the table element p["main"] as a function. return "Hello world" -- The string result of the function. end -- Ends the block defining the function object p["main"] (or p.main).

return p -- This returns the table p, which under the key "main" contains the -- function above (p.main), which when called returns string "Hello world".