Re: Exception handling (was: Quickies about the new GObject)
- From: Derek Simkowiak <dereks kd-dev com>
- To: Havoc Pennington <hp redhat com>
- Cc: gtk-devel-list redhat com
- Subject: Re: Exception handling (was: Quickies about the new GObject)
- Date: Thu, 1 Jun 2000 13:41:55 -0700 (PDT)
-> 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]