The Freya Programming Language

Try/finally statements

See also

A try/finally statement ensures that some of its dependent statements are always executed, even when exceptions are raised.

Syntax

Actually, the try/finally is just a particular variant of the more general try/except statement. This is the try/finally statement syntax:

try
    statement-list
finally
    statement-list
end

The finally clause is always executed, even if an exception is raised while executing the first statement list. In that case, after executing the statement list in the finally clause, the exception would be automatically reraised.

The using statement can be used to simplify some applications of the try/finally statement.

See also

The Freya Programming Language
Statements
raise statements
try/fault statements
try/except statements
using statements
Expressions