lua-users home
lua-l archive

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


Try this:

~~~ file localisglobal.lua
setmetatable(_ENV,{__newindex = function (ENV,name,value)
   if name:match"^%a%d?$" then
      print(": A global name like '"..name.."' is asking for trouble")
   end
   rawset(ENV,name,value)
end})

local Y=2
~~~