Putting the cdefs in a separate file file and using require does the trick. Thanks to you all! Ed -----Original Message----- From: luajit-bounce@xxxxxxxxxxxxx [mailto:luajit-bounce@xxxxxxxxxxxxx] On Behalf Of Geoff Leyland Sent: Thursday, October 9, 2014 5:29 PM To: luajit@xxxxxxxxxxxxx Subject: Re: LuaJIT2.1-alpha question On 10/10/2014, at 12:18 pm, Maynard, Ed <Ed.Maynard@xxxxxxxxxxxxxxxx> wrote: > In the meantime, it appears that this is a well-known issue (redefinition of > C structures) without a built-in solution other than creating a new instance > of Lua (akin to exit and restart). It also appears that there is no ready way > to evaluate whether a variable has been declared or not - no table to look > through. Can you just stick the cdefs into a separate file and require it? If C structure definitions are being remembered, surely package.loaded is being remembered as well? This message and any attachments may be a confidential attorney-client communication or otherwise be privileged and confidential. If you are not the intended recipient, any review, distribution or copying of this transmittal is prohibited. If you have received this transmittal in error, please reply by e-mail and delete this message and all attachments.