lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo wrote:
> > function ronly(t,i) error("Protected table!",4) end
> > function ronly_set() setmetatable(__tMemory,{__index=_G,__newindex=ronly});end
> > 
> > Now my question is, how can I change it back and forth from readonly to editable?
> 
> setmetatable(__tMemory).__newindex=nil

wouldn't that be:

getmetatable(__tMemory).__newindex=nil

?

-- 
Javier