A very interesting question came up on #perl today, so I'm
forwarding it to p6l for discussion/decision.

Given the following code:

    sub foo() { return 1; }
    sub bar() { warn "oops"; }
    
    {
        CONTROL { ... }
        foo();
        bar();
    }

S04 seems to clearly indicate that the CONTROL block above would 
be invoked by the C<warn> exception thrown by bar().  The #perl6
question is, do the same semantics apply for C<return> -- i.e., 
would the return exception thrown in foo() also invoke the 
CONTROL block in the caller?

Both interpretations have validity, which is why I'm bringing
it here for further reflection and guidance.

Pm

Reply via email to