lua-users home
lua-l archive

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


Ben Kelly wrote:
> Wow, it's been a while. Got distracted by various things, but now beta 2
> is here. Comments, criticisms, bug reports, feature requests, and
> patches are welcome.


In read.lua:
   u = u * 2^8 + s:sub(i,i):byte()
could be changed to
   u = u * 2^8 + s:byte(i)

BTW: "2^8", will this this optimized by the interpreter, or
should you rather write 256?

Generally: nice, luaish peace of code.

The tricky module-mechanism is not easy to
understand. I mean things like this

     local name = (...):gsub('%.[^%.]+$', '')
     local read = require (name..".read")

and similar lines.
Wouldn't it be worthwhile to explain this idiom and
put it as a "Lua-Mini-Gem" to the Wiki?
(while we are waiting for the Lua Gemas ;-)

Christof