Exit Statement

next up previous contents index
Next: Make Statement Up: Statements Previous: Resignal Statement

Exit Statement

The exit statement provides a signal-like transfer of control to a local handler, without terminating the current invocation.

The exit statement has the form

exit <name> ["(" <expr> ["," <expr>]* ")"]
An exit statement raises a local exception that must be handled explicitly by a when arm of a containing except statement; the compiler reports an error if an exit is not handled, or is handled by a resignal or others handler. Furthermore, the handler must handle any results explicitly: if there are [tex2html_wrap2950] results, the decls in the matching arm must declare [tex2html_wrap2952] variables, with types that are supertypes of the associated expressions in the exit statement.