Thread deep copy eines Arrays
(0 answers)
Opened by Kuerbis at 2016-10-12 09:03
Hallo,
ist diese Art ein mehrdimensionales Array zu kopieren "state of the art"? Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #!/usr/bin/env perl6 use v6; my @orig = ( [ 'name' ], [ 'year' ], [ 'color', 'green' ], [ 'city' ] ); my @copy = @orig.deepmap( -> $c is copy { $c } ); @copy[1][1] = 1956; say @copy; say @orig; |