gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] Nit


From: David Brown
Subject: Re: [Gnu-arch-users] Nit
Date: Tue, 21 Oct 2003 10:54:38 -0700
User-agent: Mutt/1.5.4i

On Tue, Oct 21, 2003 at 08:54:33AM -0700, Tom Lord wrote:

>    ...
>    But I'll almost never want that in a language that lacks GC and,
>    when I do, I can achieve the effect with setjmp/longjmp.
>    I certainly don't want it to be the default in _any_ language.
>    ...

BTW, these issues have been long debated, for many years, much of it
going into the design of the Ada language.  Most languages that
implement exceptions have settled onto a similar solution, usually just
adding stuff to return values, rather than just raising a simple
exception.  Doing this well requires GC.  It can be done poorly, as C++
demonstrates.

I think the problem described with the exception raised by a called
function is an error of trying to reuse the same exceptions by the
different parts of the code.  Ultimately, it is a bug in the code
calling that function.

Exceptions can be quite useful, but like OO they also have a tendency to
obscure what is happening in the code (although much less so than OO).
Even with simple, well thought-out exceptions, such as those in Ada, it
is possible to have catastrophic results (think Ariane V).

Dave




reply via email to

[Prev in Thread] Current Thread [Next in Thread]