I am trying to get Lua to work with the new programming language D. Everything works fine (library, lua52.dll, etc.), but luaL_getmetatablecrashes. The function was not originally defined in dlua, but I added it:
void luaL_getmetatable(lua_State* L, const(char)* s) {
lua_getfield(L, LUA_REGISTRYINDEX, s);
}
But when I run:
L = lua_open();
luaL_openlibs(L);
luaL_dostring(L, "os = nil; io = nil");
luaL_newmetatable(L, "vector");
luaL_getmetatable(L, "vector");
it will work. Any ideas why this is?
source
share