[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: table.copy
- From: Mark Hamburg <mhamburg@...>
- Date: Wed, 25 Jun 2003 15:40:58 -0700
on 6/25/03 3:19 PM, Tom Spilman at tom@sickheadgames.com wrote:
>> An example is: How is table recursion handled? The way you want to deal
> with
>> this is application dependant.
>
> Wouldn't general consensus be to recursively make copies of nested
> tables or just take a reference to them?
Actually, my standard definition would be to do a shallow copy.
A shallow copy seems useful because doing it in the library could access the
underlying data structures to do it a lot faster than iterating over the
table and building a new table.
A deep copy if one wanted one could be built in Lua code on top of a fast
shallow copy.
Mark