Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Out of CONTROL...?

0 views
Skip to first unread message

Patrick R. Michaud

unread,
Dec 8, 2008, 3:32:14 PM12/8/08
to perl6-l...@perl.org
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

0 new messages