Created
June 10, 2011 11:14
-
-
Save anonymous/1018634 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
pmichaud@kiwi:~/nom$ cat return | |
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); | |
pmichaud@kiwi:~/nom$ ./perl6 return | |
true | |
false | |
pmichaud@kiwi:~/nom$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment