lua-users home
lua-l archive

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


Thanks for all the quick replies.  I'm going to try to dissect Tomas's 
response here to see if I can figure out what's going on:

The following two just find the global function _TRACEBACK (presumably 
part of the Debug library?) and place its address on top of stack?

> lua_pushliteral(L, "_TRACEBACK");
> lua_rawget(L, LUA_GLOBALSINDEX);  /* get traceback function */

This then gets the index of the _TRACEBACK function on the stack
> err_func = lua_gettop (L);

Then you call with that index -- presumably if you do anything to 
stack before this call, the err_func will no longer be valid, right?

> return (luaL_loadfile (L, name)) || (lua_pcall (L, 0, 0,
> err_func)); }