Created
August 2, 2015 18:11
-
-
Save skids/322c06d96ea46a2ce67c to your computer and use it in GitHub Desktop.
working proxy
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
use v6; | |
class A { | |
has $!a; | |
method a is rw { | |
Proxy.new( | |
FETCH => -> $self { $!a }, | |
STORE => -> $self, $v { $!a = $v } | |
); | |
} | |
} | |
my $o = A.new; | |
$o.a = 123; | |
say $o.a; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment