On Sun, 08 Jun 2008 20:17:33 +0300, Niklas Holsti wrote:
> I agree that exception contracts would work in this example. Ok,
> exception contracts would reveal some -- perhaps most -- of these
> errors at compile time, but not all.
Nothing can reveal all errors.
But errors in exceptions became painful in Ada. I permanently run into the
stuff, like when an unhandled exception winds up controlled objects,
causing secondary exceptions in Finalizes (which may not happen if the
primary exception were handled). It is very difficult to trace back.
[...]
> I agree that an application could not *recover* from failures in
> package elaboration. But the application could possibly fail more
> gracefully, perhaps even continue operating in a degraded mode.
I think that partitions could be a better candidate for such things.
Maybe it is a "philosophy" again, but to me failed declarations is a
correctness problem, rather than an exceptional state. As such it should
not be handled inside itself.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


|