Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created May 3, 2010 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashgti/388632 to your computer and use it in GitHub Desktop.
Save ashgti/388632 to your computer and use it in GitHub Desktop.
sub foo($i) {
return pir::newclosure__PP({ $i });
}
my $a := foo(1);
my $b := foo(3);
pir::say($a());
pir::say($b());
> parrot test.pir
1
3
sub foo($i) {
return { $i };
}
my $a := foo(1);
my $b := foo(3);
pir::say($a());
pir::say($b());
> parrot withoutnewclosure.pir
3
3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment