page 49, in function list_iter
:
return (i <= n) and t[i]should be
if i <= n then return t[i] end(Thanks to Anders Topper).
page 74, third chunk of code:
printResult(v)
should be printResult(p)
.
page 76, in function download
:
return count
should be print(file, count)
.
(On the next page, in function receive
,
settimeout
may be timeout
,
depending on the version of LuaSocket that you use.)
page 92, last chunk of code:
for j=i,M do
should be for j=1,i do
(thanks to Enrico Colombini).
page 122, second chunk of code:
if rawget(var) == nil thenshould be
if rawget(_G, var) == nil then
page 126, function complex.inv
:
return complex.new(c.r/n, c.i/n)should be
return complex.new(c.r/n, -c.i/n)(Thanks to John Hauser).
page 129, first chunk of code:
if rawget(_REQUIREDNAME) == nil thenshould be
if _REQUIREDNAME == nil then
page 130, second chunk of code: Similar to previous correction.
page 139, last chunk of code:
if self.balance - v <= self:getLimit() thenshould be
if v - self.balance >= self:getLimit() then(thanks to Yu Ping Hu).
page 144, first chunk of code, function getBalance
:
return self.balance + self.extra()should be
return self.balance + extra()(thanks to Byron Mattingly).
page 162, last chunk of code:
PI
should be math.pi
(thanks to Florian Berger).
page 167, third and fourth chunks of code:
strfind
should be string.find
(thanks to Florian Berger).
page 190, second chunk of code:
print(setlocale("ISO-8859-1", "collate")) --> ISO-8859-1should be
print(os.setlocale("ISO-8859-1", "collate")) --> ISO-8859-1(thanks to Florian Berger).
page 190, last chunk of code: That example only works in interactive mode (thanks to Luiz Henrique de Figueiredo).
page 204, first chunk of code:
vfprintf(stderr, argp);should be
vfprintf(stderr, fmt, argp);(thanks to Alan Ritter).
page 213, last chunk of code:
#include <lua.h>should be
#include <lua.h> #include <lauxlib.h>(thanks to Florian Berger).
page 219, first chunk of code:
return (x^2 * sin(y))/(1 - x)should be
return (x^2 * math.sin(y))/(1 - x)(thanks to Tomas Gorham).
page 223, only chunk of code; and page 224, second chunk of code:
static int l_sin (lua_State L) {should be
static int l_sin (lua_State *L) {(thanks to Helcio Mello).
page xvi, first and second paragraphs:
htpp
should be http
.
(Thanks to Florian Berger).
page 13, Section 2.5, second paragraph: IndexPascal should be Pascal.
page 34, fourth chunk:
a = {foo()
should be a = {foo0()
(thanks to Tomas Gorham).
page 39, second from last line: oder should be other (thanks to Kurt Jung).
page 73:
call permget
with should be
call permgen
with
(thanks to Tomas Gorham).
page 82, second line: "can becomes" should be "becomes" (thanks to Enrico Colombini).
page 139, end of the first (long) paragraph: "and there if finds" should be "and there it finds" (thanks to Tomas Gorham).
page 184, fourth line: "of any like" should be "of any line" (thanks to Steve Elkins).
page 201, fourth line: "You may be wandering" should be "You may be wondering" (thanks to Steve Elkins).
page 204, first line after second chunk of code: "and is using" should be "and are using" (thanks to Enrico Colombini).
page 214, second-to-last paragraph: "the user is already able do" should be "the user is already able to do" (thanks to Tomas Gorham).
page 233, last paragraph of Section 27.2: "it is an error to call this function is the" should be "it is an error to call this function if the" (thanks to Tomas Gorham).
page 256, third comment in first chunk of code: "prepare environment for hanlders" should be "prepare environment for handlers" (thanks to Tomas Gorham).