[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Jumping out of a function without error semantics
- From: Noah Watkins <jayhawk@...>
- Date: Mon, 28 Jan 2013 12:12:35 -0800
We are wrapping some C code that has a commit/abort semantics. Our Lua functions look like:
function do_something(context)
… do stuff …
if (condition)
context.abort()
end
We map context.abort() to lua_error, and all other return paths are an implicit commit/success. We'd like to provide an explicit context.commit() function that never returns, but doesn't necessarily use the lua_error mechanism.
Is there a way to return back to lua_pcall with success from C?
Thanks,
Noah