Comments welcome.
I have some small remarks. First, as a general rule, I think you should describe mainly Lua 5.2 release and not 5.1.
This is because if you convince NetBSD to use Lua as a configuration language, they will use the latest version, won't they?
While you don't mention the actual Lua version in your text, the way you describe _G indicates this.
- Section 1.1: "Global variables in Lua are actually entries in a table named G,", replace _G by _ENV and the phrase becomes true. Otherwise, this is not always the case, _G is not guaranteed to match the current environment (being _ENV of 5.2 or getenv() of 5.1 )
- Section 1.2: same remark, gsub("_G", "_ENV")
- Section 1.3: "if, then, for": typeset these keywords like code with a fixed font. I will note this as <code> afterwards, as in DocBook (*).
- Section 1.4: explicetely -> explicitly
- Section 2: replace all _G by _ENV and explain this is the *current* environment
- Section 3.1 and 3.2: <code> missing at numerous places
- Section 3.2: This section is essentially wrong !
- Loading and compiling are the exact same thing, check what you meant.
- luaL_dofile and luaL_dostring also _executes_ the result
- but since the chunk is already executed, you don't call lua_call or lua_pcall afterwards.
- I think you want to replace mention of luaL_dofile and luaL_dostring in the first list by lua_load, luaL_loadstring and luaL_loadfilex, with their Lua 5.2 signature.
- Section 4: Thanks for citing a paper of mine in your article. This does not happen often and is a pleasure.
I hope this helps.
(*) in case you are actually using DocBook, I have written a Lua syntax highlight add-on that could enhance your document.
--
-- Patrick Rapin
-- coauthor of "Le guide de Lua et ses applications", D-BookeR