[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: AW: Assignment of tables?
- From: "Jason P" <ahq_ranger@...>
- Date: Sun, 16 Nov 2003 14:14:16 -0500
> lets say I need to reset a table to some older state. Will this work?:
> MyTable = OlderTable;
> and what would happen to C refs which are attached to 'MyTable'?
With the assignment you only assign a reference to the table.
After this instruction, both MyTable and OlderTable refer to the
same structure. If you change one, the change is visible from the
If MyTable was the only reference to that table, before you re-
assigned it, the table still stays in memory and will sometime
be collected by the garbage collector (at least at program exit).
If there are other references left, nothing will happen to the table.
ok, I understand. So there are no easy copytable() type abilities inside
lua's base lib?
Send a QuickGreet with MSN Messenger