lua-users home
lua-l archive

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


> I also noticed a
>     lua_assert(L->errfunc == 0 && L->nCcalls == 0);
> in lua_resume, so I guess I can't/shouldn't set an error function before
> resuming. But how can I add an error function "inside" the resume without
> doing it in a new c function causing the above error?

Currently there is no way to do that :(


> And, if it's not possible with the given lua implementation, why can't I
> just modify lua_resume to include an error handler? (there must be some
> reason for that assertion...)

That assertion is crucial.  You cannot yield across a C call, because
there is no way to suspend the C stack.  But you can modify lua_resume
in a way similar to lua_pcall, so that it receives an extra argument
with an error handler.

-- Roberto