Created
August 3, 2015 20:28
-
-
Save ronaldxs/fe83eac02aa690f787d3 to your computer and use it in GitHub Desktop.
Looks like bug with return value of Proxy.new
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 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