Last active
August 24, 2016 20:43
-
-
Save awwaiid/faa4a37e5769337f3b01fca111a7925c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub no-catch-control { | |
die "no-catch-control exception"; | |
} | |
sub catch-control { | |
CONTROL { | |
say "CONTROL: {$_.gist}"; | |
die "control exception"; | |
} | |
die "catch-control exception"; | |
} | |
say "**** no catch control ****"; | |
for 1 { | |
no-catch-control; | |
CATCH { | |
say "EXCEPTION: {$_.gist}"; | |
next; | |
} | |
} | |
say "**** WITH catch control, dies upon 'next' in CATCH ****"; | |
for 1 { | |
catch-control; | |
CATCH { | |
say "EXCEPTION: {$_.gist}"; | |
next; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**** no catch control **** | |
EXCEPTION: no-catch-control exception | |
in sub no-catch-control at catch-control.p6 line 2 | |
in block <unit> at catch-control.p6 line 19 | |
**** WITH catch control, dies upon 'next' in CATCH **** | |
EXCEPTION: catch-control exception | |
in sub catch-control at catch-control.p6 line 12 | |
in block <unit> at catch-control.p6 line 31 | |
CONTROL: Died with CX::Next | |
control exception | |
in sub catch-control at catch-control.p6 line 9 | |
in block <unit> at catch-control.p6 line 31 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment