-
-
Save zoffixznet/777579558a0d9c8b4948065f64ec513e to your computer and use it in GitHub Desktop.
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 MONKEY; | |
augment class BagHash { | |
method clone2 { | |
nqp::p6bindattrinvres( | |
nqp::create(self), self.WHAT, '%!elems', | |
nqp::getattr(self, self.WHAT,'%!elems').clone | |
) | |
} | |
} | |
my $a = BagHash.new: <a b c>; | |
my $b = $a.clone2; | |
$a<a> = 55; $a<b> = 3; $a<z> = 42; $a<x>++; | |
dd [$b]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment