Resignal Statement



next up previous contents index
Next: Exit Statement Up: Statements Previous: Except Statement

Resignal Statement

A resignal statement is a syntactically abbreviated form of exception handling:
<statement> resignal <name> ["," <name>]*
Each name listed must be distinct, and each must be either one of the condition names listed in the routine heading or "failure". The resignal statement acts like an except statement containing a handler for each condition named, where each handler simply signals that exception with exactly the same results. Thus if the resignal clause names an exception with a specification in the routine heading of the form name(T1, ..., Tn), effectively there is a handler of the form
when name (x1: T1, ..., xn: Tn): signal name(x1, ..., xn)
The compiler checks all exceptions that can be raised by the statement that the resignal is attached to against these implicit handlers. As discussed above, an error is reported if an exception can be raised with the wrong number of arguments, or if the [tex2html_wrap2946]th result type is not a subtype of the type of the [tex2html_wrap2948]th variable declared in the handler.



theta-questions@lcs.mit.edu