Created
May 3, 2010 21:55
-
-
Save ashgti/388632 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
sub foo($i) { | |
return pir::newclosure__PP({ $i }); | |
} | |
my $a := foo(1); | |
my $b := foo(3); | |
pir::say($a()); | |
pir::say($b()); |
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
> parrot test.pir | |
1 | |
3 |
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
sub foo($i) { | |
return { $i }; | |
} | |
my $a := foo(1); | |
my $b := foo(3); | |
pir::say($a()); | |
pir::say($b()); |
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
> parrot withoutnewclosure.pir | |
3 | |
3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment