lua-users home
lua-l archive

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


On Thu, Feb 25, 2010 at 9:36 AM, Geoff Leyland
<geoff_leyland@fastmail.fm> wrote:
> It turns out this has been thought about before: http://lua-users.org/wiki/DetectingUndefinedVariables
> So, in the spirit of Lua, I read everyone else's and wrote my own.

Which of course is what I did ;)

> It's extra feature is that it overrides "module" and "setfenv".  I didn't seem to run into trouble > replacing _M's __index - is that because I don't use package.seeall?

I'll have a look.  If you did use package.seeall, then the undefined
lookup would go up to _G which would complain bitterly.  So it works
out.

What about the constraint that fields of _M may only be modified by
functions inside _M? That seems a good generalization.

steve d.