From: [EMAIL PROTECTED]
   Date: Sat,  8 Jul 2006 16:48:28 -0700 (PDT)

   Author: allison
   Date: Sat Jul  8 16:48:27 2006
   New Revision: 13214
   Modified:
      trunk/docs/pdds/pdd23_exceptions.pod

I have a question about C<handled>.  r13214 adds item 2 in the following
snippet from the current revision:

        When the C<handled> opcode is called:

        =over

        =item 1
        Pop and destroy the exception record.

        =item 2
        If there was a continuation in the exception record, invoke the
        continuation.

        =back

According to C<throwcc>, this continution is for resuming execution from
the error point:

        =item B<throwcc I<EXCEPTION> [ , I<CONTINUATION> ]>

        Throw an exception consisting of the given I<EXCEPTION> PMC after taking
        a continuation at the next opcode.  When a I<CONTINUATION> is passed in,
        it will use that instead. Active exception handlers (if any) will be
        invoked with I<EXCEPTION> and the given continuation as parameters.

That would mean that C<handled> is really causing resumption, true?  But
the C<handled> op description still merely says:

        =item B<handled I<EXCEPTION>>

        While handling an exception, tell Parrot that the exception has
        been handled and should be removed from the stack of active
        exceptions.  This opcode is an exception handler's way of
        telling Parrot that it has handled the exception.

It doesn't mention this possible nonlocal exit.  It also doesn't mention
the fact that handlers that want to do something other than resuming
must *not* call C<handled> if they want to retain control, which seems
to contradict what Chip said on 24-June.  On the other hand, not calling
C<handled> would leave the "exception record" in place, which also seems
wrong.

   So I am confused.  What is the intent here?

   TIA,

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

Reply via email to