Skip to content

Instantly share code, notes, and snippets.

@skids
Created August 2, 2015 18:11
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 skids/322c06d96ea46a2ce67c to your computer and use it in GitHub Desktop.
Save skids/322c06d96ea46a2ce67c to your computer and use it in GitHub Desktop.
working proxy
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