[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Read only tables.
- From: Javier Guerra <javier@...>
- Date: Tue, 16 Jun 2009 20:28:10 -0500
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