Skip to content

Instantly share code, notes, and snippets.

@ronaldxs
Created August 3, 2015 20:28
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 ronaldxs/fe83eac02aa690f787d3 to your computer and use it in GitHub Desktop.
Save ronaldxs/fe83eac02aa690f787d3 to your computer and use it in GitHub Desktop.
Looks like bug with return value of Proxy.new
sub triple() is rw {
my $storage = 0;
my $p = Proxy.new(
FETCH => method () { $storage },
STORE => method ($new) { $storage = 3 * $new }
);
say $p.perl; #the output here is probably a bug
$p;
}
my $tripled := triple();
$tripled = 4;
say $tripled;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment