IMPLICIT exceptions
Motivation
We need some mechanism for handling checked runtime errors in
Modula-3. We have added implicit exceptions, which are exceptions
that any procedure can raise.
Implementation
The compiler takes a pragma <* IMPLICIT *>, which is used to suppress
warnings about implicit exceptions.
<* IMPLICIT *> EXCEPTION Foo;
This pragma means that foo can be raised by any procedure.
- Do not issue a warning if a procedure raises it, and Foo is not
in its RAISES clause.
- Do not issue a warning if a TRY EXCEPT block catches Foo, even if
nothing in the block apparently RAISES Foo.
The SPIN runtime translates checked runtime errors into implicit
exceptions.