lua-users home
lua-l archive

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



On 18-Sep-04, at 3:06 AM, Tom Spilman wrote:

To wrap this thread up.  What seemed like the right thing to do, count
LUA_HOOKCALLs to keep track of the stack depth, is a bad idea.  First
because LUA_HOOKCALL changes meaning when it's a tail call as the stack
depth doesn't change (how about a LUA_HOOKTAILCALL?).

Yes. LUA_HOOKTAILCALL was precisely my suggestion; then you can add one
on LUA_HOOKCALL, subtract one on LUA_HOOKRETURN, and do nothing on
LUA_HOOKTAILCALL.

However, there are other events that change call stack depth, such as
error()/pcall() and yield()/resume().