Effective February 22, 2024, Google Groups will no longer support new Usenet content. Posting and subscribing will be disallowed, and new content from Usenet peers will not appear. Viewing and searching of historical data will still be supported as it is done today.
Dismiss

Out of CONTROL...?

0 views
Skip to first unread message

Patrick R. Michaud

unread,
Dec 8, 2008, 9: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

Reply all
Reply to author
Forward
0 new messages