[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: checking types without tags
- From: Ignacio Castaño <castanyo@...>
- Date: Thu, 23 May 2002 05:13:17 +0200
I've been reading that example in lua-users.org and I don't fully undestand
the function check_image:
if( ! lua_equal(L, lua_upvalueindex(1), -1) )
luaL_typerror(L, index, "Image"); /* die */
to check that the index is an Image, the metatable of the image and the
upvalue should be the same, but why is the metatable of the Image in the
index 1 in this moment?
When calling a metatable method, is the upvalue also placed in the
pseudo-stack? And what if the method of the metatable also has upvalues? are
they placed in the next indices or do they overwrite the previous upvalues?
Thanks in advance,
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com