[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Read only tables.
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Wed, 17 Jun 2009 18:10:39 +0200
>> Van: Luiz Henrique de Figueiredo <email@example.com>
>>> > setmetatable(__tMemory).__newindex=nil
>>> wouldn't that be:
>> oops, you're right, sorry.
> Thank you for your help, another thing learnen about metatables.
With that solution, once some keys are added to the table, reseting
the __newindex to the ronly function won't be enough to make it
read-only again. __newindex is only called if the key is not in the