From: Larry Wall <[EMAIL PROTECTED]>
   Date: Thu, 24 Jan 2008 09:52:16 -0800

   In addition to what Patrick said, which is all right on the mark,
   I'd like to point out a few additional subtleties.

   Perl borrows an important idea from Lisp and separates the notion
   of stack unwinding from that of exception handling; when you throw
   an exception (including a control exception) you look for a handler
   without unwinding the stack.  Only after you have determined which
   handler handles the exception do you decide what to do with the
   stack.  (Among other things, this lets you treat warnings as merely
   a resumable form of exception, which lets you use exception handlers
   to trap warnings propagating outward instead of inventing a separate
   mechanism for that.  Non-destructive control flow also tends to be
   friendlier to concurrency.)

One of those other things (which I hope you don't mind me adding) is
that search-before-unwind also supports default exception handlers with
an elegantly simple idiom:  In the default handler, resignal the error;
if it returns, it's all yours.  The "Default Handling" section of [1]
has a fuller explanation in the context of Lisp dialects and their
influences.

                                        -- Bob Rogers
                                           http://rgrjr.dyndns.org/

[1]  http://www.nhplace.com/kent/Papers/Condition-Handling-2001.html

Reply via email to