I'm trying to get Lua to work with the new programming language D.
Everything works fine (library, lua52.dll, etc.) but luaL_getmetatable crashes.
Originally, the function was not defined in dlua, but I added it:
//C #define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
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);
// prevent script kiddies
luaL_dostring(L, "os = nil; io = nil");
// reprogram 'print'
luaL_newmetatable(L, "vector");
luaL_getmetatable(L, "vector"); // CRASH
it crashes. Any ideas why this is?