lua-users home
lua-l archive

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


I'm trying to catch the 'function' tag for tables,
like so:

  int callConstructor(lua_State* L);
  lua_pushcfunction(L, callConstructor);
  lua_settagmethod(L, LUA_TTABLE, "function");

Now according to the docs, when the tag handler gets
called, there should be a table on the stack
containing the arguments to the function, and the
first entry should the name of the function that was
called. However, when I do this in Lua

  someTbl = { }
  someTbl()

...the function tag handler gets called with a table
on the stack, but the table is *empty* (that is,
lua_getn(L,1) == 0). Am I misinterpreting the docs?

Jason
379


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/