lua-users home
lua-l archive

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


Is there any news as to what (if any) strategy might be adopted 
officailly by Lua to control access to globals?  Having the option of 
requiring global access declarations would make Lua much more robust.

I've already written something like 

$noglobals
z=10
q=45
g=54

function example(x)
local w,y
global z,q
   w=x*x
   print(w+x+q)
   print(g)  -- error
end

In standard mode lua just ignores the global list, so this code works in 
either mode ($globals or $noglobals).

Russ