lua-users home
lua-l archive

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


>>Like strict.lua, this only covers undefined globals.

Well, if a local isn't defined it's supposed to look for the global. If that wasn't the case you couldn't use globals anymore (except prefixing em all),,,,,,so the global metatable seems to be the mst useful mechanism for detecting undefined variables.
If you didn't define a local, and a global exists, it's technically not undefined.

Or do you mean to trap nil on table members (ie in a class system)? Then you gotta set the metatable on that table.

But having it look for a local and not falling back to globals seems rather un-Lua to me.

Kaj