Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement multi-dim array assignment
  • Loading branch information
niner committed Aug 28, 2015
1 parent 51b313b commit 901d7c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/array_slice.pm
Expand Up @@ -333,7 +333,7 @@ multi sub postcircumfix:<[ ]>(\SELF, :$v!, *%other) is rw {

proto sub postcircumfix:<[; ]>(|) is nodal { * }

sub MD-ARRAY-SLICE-ONE-POSITION(\SELF, \indices, \idx, int $dim, \target) {
sub MD-ARRAY-SLICE-ONE-POSITION(\SELF, \indices, \idx, int $dim, \target) is rw {
my int $next-dim = $dim + 1;
if $next-dim < indices.elems {
if nqp::istype(idx, Iterable) && !nqp::iscont(idx) {
Expand Down Expand Up @@ -378,13 +378,13 @@ sub MD-ARRAY-SLICE-ONE-POSITION(\SELF, \indices, \idx, int $dim, \target) {
}
}
}
sub MD-ARRAY-SLICE(\SELF, @indices) {
sub MD-ARRAY-SLICE(\SELF, @indices) is rw {
my \target = IterationBuffer.new;
MD-ARRAY-SLICE-ONE-POSITION(SELF, @indices, @indices.AT-POS(0), 0, target);
nqp::p6bindattrinvres(List.CREATE, List, '$!reified', target)
}

multi sub postcircumfix:<[; ]>(\SELF, @indices) {
multi sub postcircumfix:<[; ]>(\SELF, @indices) is rw {
my int $n = @indices.elems;
my int $i = 0;
my $all-ints := True;
Expand Down

0 comments on commit 901d7c4

Please sign in to comment.