lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi!

I have started to read the book and I have some doubts
about the chapter 4: Serialization with Pluto

In page 36, the first time Pluto is used, there are some uses
of the "io" library which do not seem correct.

The code there is:

infile = io.open("test.plh", "rb")
encoded = io.read("*a")
infile.close()

I think it should be:

infile = io.open("test.plh", "rb")
encoded = infile:read("*a")  -- using the file handle "infile"
infile:close()   -- using the ":" operator now

The same thing happens in Listing 2.


Two minor comments about Chapter 3: Vardump

Page 29, third paragraph: I think "an generic" should be "a generic"
Listing 1: in the second "if-else", the else's alternatives are not aligned.


Sérgio


      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com