Exception handling transfers control from an operation that signals an exceptional condition to a matching handler. A parser can signal a malformed input instead of returning an ordinary result; a surrounding handler can report or recover from that case. Propagation may unwind intervening call frames, so cleanup constructs specify what happens to resources during exit. Checked and unchecked exception rules differ by language. Catching an exception does not itself restore an invariant damaged before it was raised, and silently discarding every exception can hide a failed computation.
// Target: computer-science.bigb
In Standard ML,
exn is an extensible datatype of exception packets. Fresh declarations introduce constructors, optionally with payloads; rebinding can alias an existing constructor; raise propagates a packet and handle performs dynamic pattern-based recovery.// Target: computer-science.bigb
Articles by others on the same topic
There are currently no matching articles.