[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Detecting any changes in a set of Lua objects from C
- From: Marc Balmer <marc@...>
- Date: Fri, 4 Jan 2013 21:38:03 +0100
> Apologies if this seems half-baked.
> I am wondering if it is possible, or even a common pattern, to be able to specify a set of objects (say tables) at time A, and later at time B to be able to know if that set of objects has had any changes.
> By any changes, I mean:
> - removed fields
> - added fields
> - changed field values
> - changed metatables and values in metatables
> Assume the ability to add C code to do this (i.e. it doesn't have to be done in pure Lua).
> Basically, I am asking if I can know if there have been changes to a set of Lua objects, from C, without having to proxy out everything in Lua to detect it there.
you could iterate over the table and calculate a checksum. reiterate later to see if it changed.