[sm130futures] Start moving externs to consistent location.

This commit is contained in:
Jason Felds
2011-05-04 17:56:36 -04:00
parent 4e8b475377
commit 808f67e9f0
101 changed files with 221 additions and 572 deletions
+12
View File
@@ -0,0 +1,12 @@
-- make global variables readonly
local f=function (t,i) error("cannot redefine global variable `"..i.."'",2) end
local g={}
local G=getfenv()
setmetatable(g,{__index=G,__newindex=f})
setfenv(1,g)
-- an example
rawset(g,"x",3)
x=2
y=1 -- cannot redefine `y'