[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Clone nested table
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 17 Jun 2003 14:07:35 -0300
>I have a system using templates. The application users will take an
>existing table, and clone it to create a copy which they then can tweak.
Instead of cloning a table A into a table B, why not create an empty table B
and set the __index metamethod of B to be A? With this setup, reading from B
reads from A, but writing to B writes to B, not to A. To handle tables inside A,
the __index metamethod would have to set the same scheme for these tables.