lua-users home
lua-l archive

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


>> So I think the expected practice is to compile Lua's ldo.c as C++. It
>> will define Lua's internal mechanism for pcall to use try/catch
>> instead of setjmp/longjmp. Then if a C++ exception does occur, pcall
>> will be aware of it and catch it and then you just do the normal error
>> handling thing. No need to do anything elaborate.
>
> That makes sure that Lua doesn't end up in an inconsistent state, but it
> doesn't solve the bigger issue:
>
> With a "outer C++ calls Lua calls inner C++" call-chain you really want the
> outer C++ to be able to catch the exception thrown by the inner C++
> function.
>

Sorry, I got confused about the intent.  I think your rethrow idea
sounds best. Maybe modifying ldo.c to centralize this for you would be
ideal.


-Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/