Created
June 10, 2011 11:14
-
-
Save anonymous/1018633 to your computer and use it in GitHub Desktop.
This file contains 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
my &return = -> \$parcel { | |
Q:PIR { | |
.include 'except_types.pasm' | |
.include 'except_severity.pasm' | |
.local pmc ex | |
ex = root_new ['parrot';'Exception'] | |
$P0 = box .CONTROL_RETURN | |
setattribute ex, 'type', $P0 | |
$P0 = find_lex '$parcel' | |
setattribute ex, 'payload', $P0 | |
$P0 = box .EXCEPT_NORMAL | |
setattribute ex, 'severity', $P0 | |
throw ex | |
}; | |
0; | |
}; | |
sub abc($x) { | |
if $x { return 'true' } | |
'false' | |
} | |
say abc(1); | |
say abc(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment