lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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