[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Create a new table based on an already existed table (through Lua or C API)?
- From: Scott Morgan <blumf@...>
- Date: Thu, 21 Jan 2021 13:17:07 +0000
On 21/01/2021 12:51, 孙世龙 sunshilong wrote:
> Thank you for your clarification.
>
> I think comparing the pointers of the outer table and inner table
> could find out whether it's a recursive table or not.
> Am I right? If I miss something, please let me know.
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.
Much easier to write this directly in Lua than in C (see the
lua-users.org link in an earlier post)