lua-users home
lua-l archive

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


Sorry, hit the sent button too soon. The behaviour of the
title occurs in a long module of mine, and I am still trying
to isolate it. It's not that simple. Sorry!

2013/4/21 Dirk Laurie <dirk.laurie@gmail.com>:
> 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
> ~~~