[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Inheritance
- From: Florian Weimer <fw@...>
- Date: Sun, 09 May 2010 20:18:24 +0200
* Christoph Schreiber:
> The following code works. But I don't understand why. That drives me nuts.
>
> int ChildClass::index(lua_State* L)
> {
> const char* key = luaL_checkstring(L, 2);
> lua_getmetatable(L, 1);
> lua_getfield(L, -1, key);
> if(lua_isnil(L, -1))
> {
> luaL_getmetatable(L, Base::classId);
> lua_getfield(L, -1, key);
> return 1;
> }
A closing brace is missing in that snippet. Perhaps you did not copy
the full function? And you shold really tell us what is so surprising
to you.
Also, please do not post your questions as follow-ups to unrelated
mailing list threads.