lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


sorry, but I understand everything but this:

Peter Shook wrote:
> Then lua_getmetatable pushes the metatable for im on top of the stack.
> Then we make sure that our userdata is the right type by comparing the
> metatable of im with upvalueindex(1).  You never now, some user might
> have entered im.ColorAllocate(some_other_userdata,0,0,0).
> If our userdata is the right type, then return a pointer to our
> userdata.

Why is the metatable at upvalueindex(1)?
In: "im:ColorAllocate(255, 255, 255)" the 'gettable' event is called and it
calls 'ColorAllocate' in the 'gettable' table. But in wich moment appears
the metatable in upvalueindex(1)? Is that something that the gettable does
automatically?

I think the problem is that I don't understand how upvalues work in the new
work version. I would be very gratefull, if someone could explain that. :-)


Ignacio Castaño
castanyo@yahoo.es



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com