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: Tom Lord
Subject: Re: [Gnu-arch-users] Nit
Date: Wed, 22 Oct 2003 10:40:37 -0700 (PDT)


    > From: Robert Collins <address@hidden>

    > Have you read that Boost exceptions paper referenced earlier in this
    > thread? 

Yes.


    > It makes a good case that exceptions in generic components do
    > make sense, as long as you are clear what exception contract you are
    > offering.

C++ has the same bug as Java: unless special care is taken, the
"contracts" functions offer about what exceptions they may raise can
change in ways that lead to wrong handlers being invoked (without any
interference from static contract enforcement in Java or dynamic
contract enforcement in C++).

The same bug would be present in clu _if_ clu did not convert
unhandled errors into unrecognized errors _at_the_call_site_.  The key
difference between clu and C++ and Java is that, in clu, error
contracts are specified and enforced at each caller -- in C++ and
Java, only at each function.

Callee-side error contracts are a swindle:  The callee offers them, N
different callers accept them, the callee can get away with changing
the terms.



-t




reply via email to

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