Re: [gtk-list] Re: rfc: exceptions (code included)



On Tue, Jul 20, 1999 at 11:45:15AM +0200, Erik Mouw wrote:
> On Sat, 17 Jul 1999 20:56:31 +0200, Balazs Scheidler wrote:
> > This project has to be robust, thus I thought exceptions would be a good way
> > of handling errors. GLIB did not yet include exceptions support (at least in
> > 1.2.3, and 1.3.0)
> > 
> > Since glib includs all other functionality I need (hashtables,
> > length-encoded-string handling etc.) I thought it would be much easier to
> > extend glib, than to write my own library.
> > 
> > So you'll find my exception code attached to this mail (it's about 2k
> > compressed, so I am sending this in), any comments, suggestions welcome. I
> > would be very glad seeing it included in glib.
> 
> At first glance this looks rather useable, does it behave like C++
> exceptions? IMHO this should be included in GLIB.

Yes, they behave just like C++ exceptions, but instead of keywords you have
to use macros. There are some questions open:

* maybe we should use automatic variables instead of heap allocated
  structures for GExceptionBlock, so that if a routine is exited from within
  the TRY block, that exception block gets automatically freed.
* we should check how the whole thing will interact with C++ exceptions.
  gtk-- AFAIR uses exceptions extensively, so this is a real issue
* there should be some automatic way to rethrow an exception, if it's not
  handled at the current catch level.

> PS: The original message was sent to gtk-devel-list but it showed up at
>   the gtk-list. I don't know if that was the intention or if it was a
>   mailinglist error, so I send the answer to both gtk-devel-list as well
>   as gtk-list. Appologies if this message appears twice at the gtk-list.

I originally sent to gtk-devel-list, but it seems to be dead (at least I
have not received a single message since I am subscribed. I subscribed about
5 days ago) So I reposted it here.

-- 
Bazsi



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