lua-users home
lua-l archive

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


> I'm getting more and more curious as I experiment further. From a
> technical, low-level standpoint, what exactly prevents Lua hooks from
> becoming yieldable? I'd just like to patch my own copy, if at all
> possible.

When a C hook yields, it is actually making the corresponding Lua
function (that triggered the hook) yield. The hook itself does not
need to be saved.

If a Lua hook yields, a resume should resume the Lua hook itself, not
the Lua function that hooked, so the C hook should be saved.

It is not difficult to allow the Lua hook to hook the original
Lua function (e.g., by returning a specific value).

-- Roberto