[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Exceptions (was Re: Custom extensions to Lua)
- From: Diego Nehab <diego@...>
- Date: Fri, 12 Aug 2005 14:22:49 -0400 (EDT)
All we need to do is come up with a finalization mechanism that is
safe and we are all set.
I still think that we can do that with finalizers. As long as each
object has a proper finalizer (i.e., a __gc metamethod), all we have to
do in case of errors is to call collectgarbage() to finalize what was
I can buy that. But only for hard errors. The return_on_error idea would
benefit from a finalization function. In fact, I would drop my use of
exceptions altogether in LuaSocket if I could replace it with a simple
soft-error policy. I only use exceptions because I don't want to
propagate the errors up the call stack by hand.