[81] in java-interest
Static Exception Checking?
daemon@ATHENA.MIT.EDU (Dan Connolly)
Thu May 11 12:25:33 1995
Date: Thu, 11 May 1995 02:41:20 +0500
From: connolly@w3.org (Dan Connolly)
To: java-interest@java.Eng.Sun.COM
Since reading "Systems Programming with Modula-3," I'm kind of a
Modula-3 fan. Java seems to have most of the happy features of
Modula-3, plus the nifty answer to multiple inheritance in Java
interfaces (not to be confused with Modula interfaces, which are
a very different beast).
Anyway... one of the nifty features of Modula-3 is that each
procedure has a declared set of exceptions:
http://www.research.digital.com/SRC/m3defn/html/calls.html
|It is a checked runtime error for a procedure to raise an exception
|not included in its raises set (If an implementation maps this runtime
|error into an exception, the exception is implicitly included in all
|RAISES clauses.)
In practice, this allows the compiler to give warnings to the effect
of "Hey! you forgot to catch exception XXX."
In a large system, it makes keeping track of exceptions that bubble
up from many layers down feasible.
This would be an expensive change to the language, but it's pretty
valuable. I know that maintaining large bodies of C++ code that
uses exceptions is problematic because of the lack of this mechanism.
Thoughts?
Dan
p.s. I haven't subscribed to this list, so please copy me explicitly.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com