Signal Statement



next up previous contents index
Next: If Statement Up: Statements Previous: Yield Statement

Signal Statement

An exception is raised with a signal statement, which has the form
signal <name> ["(" <expr> ["," <expr>]* ")"]
where
        <name> -> <idn>
The execution of a signal statement begins with evaluation of the expressions (if any), in an unspecified order, to produce a list of exception results. The activation of the routine is then terminated and execution continues in the caller (8.14).

The exception name must be either one of the exception names listed in the routine heading or "failure". If the name is "failure", there must be exactly one expression present, of type string. If the name is listed in the routine header, there must be the same number of expressions as are listed for that exception in the header, and their types must be subtypes of the corresponding listed types.



theta-questions@lcs.mit.edu