Skip to content

Instantly share code, notes, and snippets.

@gfldex
Created July 26, 2016 18:30
Show Gist options
  • Save gfldex/688fb7e3caf68558fa04725ac0a5889a to your computer and use it in GitHub Desktop.
Save gfldex/688fb7e3caf68558fa04725ac0a5889a to your computer and use it in GitHub Desktop.
my %A = (
a => {
aa => [ 1, 2, 3, 4, 5 ],
bb => { aaa => 1, bbb => 2 },
},
);
dd %A;
my %B = %A.deepmap(-> $c is copy {$c}); # works
# my %B = %A.deepmap(-> $c is copy {$c.clone}); # doesn't copy the container
%B<a><aa>[2] = 735;
dd %A;
dd %B;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment