Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Exceptions/Raku/exceptions-1.raku
Normal file
17
Task/Exceptions/Raku/exceptions-1.raku
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
try {
|
||||
die "Help I'm dieing!";
|
||||
CATCH {
|
||||
when X::AdHoc { note .Str.uc; say "Cough, Cough, Aiee!!" }
|
||||
default { note "Unexpected exception, $_!" }
|
||||
}
|
||||
}
|
||||
|
||||
say "Yay. I'm alive.";
|
||||
|
||||
die "I'm dead.";
|
||||
|
||||
say "Arrgh.";
|
||||
|
||||
CATCH {
|
||||
default { note "No you're not."; say $_.Str; }
|
||||
}
|
||||
13
Task/Exceptions/Raku/exceptions-2.raku
Normal file
13
Task/Exceptions/Raku/exceptions-2.raku
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
sub f(){
|
||||
ENTER { note '1) f has been entered' }
|
||||
LEAVE { note '2) f has been left' }
|
||||
say '3) here be dragons';
|
||||
die '4) that happend to be deadly';
|
||||
}
|
||||
|
||||
f();
|
||||
say '5) am I alive?';
|
||||
|
||||
CATCH {
|
||||
when X::AdHoc { note q{6) no, I'm dead}; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue