PiL2 errata (?)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PiL2 errata (?)

Enrico Colombini
>From the "binary file dump" example at page 199:

  for _, b in pairs{string.byte(bytes, 1, -1)} do

Shouldn't it be "ipairs" to guarantee the correct traversal order?

  Enrico

Reply | Threaded
Open this post in threaded view
|

Re: PiL2 errata (?)

Roberto Ierusalimschy
> From the "binary file dump" example at page 199:
> 
>   for _, b in pairs{string.byte(bytes, 1, -1)} do
> 
> Shouldn't it be "ipairs" to guarantee the correct traversal order?

Sure!! Thanks for the correction.

-- Roberto