lua-users home
lua-l archive

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


On Sun, Sep 27, 2009 at 1:01 PM, Ivan Kolev <ikolev@gmail.com> wrote:
>...
> The alternative for dynamically typed languages are tests. A lot of them, as
> close to 100% coverage as possible. And you still can't be sure that your
> tests will catch any typo, or any misplaced function argument... something a
> compiler would always catch (OK, almost).
As for typos, there is a reasonable mechanism for catching this present in Lua:

For each script/module you have:
 luac -l <lua-file> | less

Then grep through  *TGLOBAL to catch sets and gets.

Ideally these should be at the very beginning of a module and/or
managed through accessors.  Now... if you have a typo when accessing
members of tables, that can be problematic.. though it's less likely
than typos when accessing items you intend to be in local-scope.

-- 
Thomas Harning Jr.