Anonymous user
Exceptions: Difference between revisions
MOO
(added Ursala) |
(MOO) |
||
Line 654:
END;
</lang>
=={{header|MOO}}==
===Throw exceptions===
Values can be raised to exceptions using raise():
<lang moo>raise(E_PERM);</lang>
===Catching exceptions===
<lang moo>try
this:foo();
except e (ANY)
this:bar(e);
endtry</lang>
MOO also has a finally statement:
<lang modula3>try
this:foo();
finally
this:bar();
endtry</lang>
===Shorthand===
<lang moo>`this:foo()!ANY=>this:bar()';</lang>
=={{header|OCaml}}==
|