lua-users home
lua-l archive

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


> On 22 Jan 2021, at 11:31, 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:
> 
>> It's complicated. You need to check each child table you copy against a
>> list of already seen tables that you need to maintain as you work
>> through everything.
> I can't agree more.
> 
>> Much easier to write this directly in Lua than in C.
> A self-defined function implemented by C makes easier for the users to
> deep copy a table.

It’s no easier or harder for a user to use a C function vs a Lua function.

It is, however, quite a bit easier to implement these things in Lua.  Doing it in C is messy.

- Peter