|
Shmuel Zeigerman wrote:
That is necessary only if you plan to use metatable as a place where Lua will look _userdata_ fields. It is a common (yet newbie-confusing) practice to store methods in metatable, instead of special separate table.You probably forgot to assign the "__index" field of the metatable to the metatable itself: luaL_newmetatable(L, "LuaBook.gc_event"); lua_pushliteral(L, "__index"); lua_pushvalue(L, -2); /* push metatable */ lua_rawset(L, -3); /* metatable.__index = metatable */
-- e.v.e