lua-users home
lua-l archive

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


On Wed, Jul 2, 2014 at 8:20 AM, David Demelier <demelier.david@gmail.com> wrote:
> It does not seems to work for 5.2 unfortunately:

My approach started at this wiki page (already referenced by lhf)

 http://lua-users.org/wiki/DetectingUndefinedVariables

and was developed as a standalone application lglob

https://github.com/stevedonovan/lglob

This does work for _both_ 5.1 and 5.2, which have different bytecode
instructions for accessing globals.  Just ensure that your luac
executable is for the right Lua.

Back to the (not so OT) subject:  large dynamic code bases need more
careful planning and testing, _plus_ static checking tools.  Messes
can be written in any language, of course.  I agree that it is not
helpful to compare C and C++, since the former has a weak static type
system - catches typos but casting Foo* to Bar* is merely a compile
warning by default.  Lua has a stronger type system because all Lua
objects have a distinct type, but it all happens at runtime, so any
static checking tools you have are a good idea, even if not perfect.

steve d.