
6 Aug
2004
6 Aug
'04
5:43 a.m.
After all, Java basically does exactly what you're asking for with
Java's head/tail would be doing runtime checks if they are throwing exceptions, static guarantees mean the program would not be allowed to compile if it broke the static guarantees.
Not so. In Java, the programmer is forced to handle most exceptions by the type system. That is, if the exception is not handled, the program will not compile, thus providing a static guarantee that exceptions are handled. Only "unchecked exceptions" (RuntimeException and Error) are exempt from this check. --KW 8-)