public Lua(bool enableLengthWorkaround)
{
// NOTE: You should enable the length workaround on Mac and Linux
this.enableLengthWorkaround = enableLengthWorkaround;
luaState = LuaDLL.luaL_newstate(); // steffenj: Lua 5.1.1 API change (lua_open is gone)
// Load libraries
LuaDLL.luaL_openlibs(luaState);
// Add LuaInterface marker
LuaDLL.lua_pushstring(luaState, "LUAINTERFACE LOADED");
LuaDLL.lua_pushboolean(luaState, true);
LuaDLL.lua_settable(luaState, (int)LuaIndexes.LUA_REGISTRYINDEX);
translator = new ObjectTranslator(this, luaState);
tracebackFunction = new LuaCSFunction(traceback);
// We need to keep this in a managed reference so the delegate doesn't get garbage collected
panicCallback = new LuaFunctionCallback(PanicCallback);
LuaDLL.lua_atpanic(luaState, panicCallback);
}