lua-users home
lua-l archive

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


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