Re: Exception handling (was: Quickies about the new GObject)



-> Because open_file() is supposed to throw the exception, not
-> my_func(). my_func() is supposed to _handle_ the exception. 
-> That's what it can't do conveniently.

	Ah... gotcha.  There's no "try" (right?).

	So signals could be used to "throw" an exception, but the signal
mechanism has no means to stop execution within a function (or change the
execution path dynamically) based on whether or not the "exception" signal
is emitted ("thrown").

	Off the top of my head, I don't see an easy way out of this
problem.  In Java, the JVM notices whether or not an Exception was thrown,
and if so it stop execution at that "try" statement.  Short of having some
elaborate thread-killing mechanism in Gtk+, I don't see how to do this
in C...


--Derek





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