package org.perl6.nqp.sixmodel.reprs;

import java.lang.System;

import org.perl6.nqp.runtime.ExceptionHandling;
import org.perl6.nqp.runtime.ThreadContext;
import org.perl6.nqp.sixmodel.SixModelObject;

public class VMArrayInstanceBase extends SixModelObject {
    public long[] dimensions(ThreadContext tc) {
        return new long[] { this.elems(tc) };
    }

    public void set_dimensions(ThreadContext tc, long[] dims) {
        if (dims.length != 1)
            throw ExceptionHandling.dieInternal(tc, "A dynamic array can only have a single dimension");
        this.set_elems(tc, dims[0]);
    }
}

@@ -598,11 +598,1161 @@
 );%0A    %7D
+%0A%0A    public SixModelObject at_pos_multidim_boxed(ThreadContext tc, long%5B%5D indices) %7B%0A        if (indices.length != 1)%0A            throw ExceptionHandling.dieInternal(tc, %22A dynamic array can only be indexed with a single dimension%22);%0A        return this.at_pos_boxed(tc, indices%5B0%5D);%0A    %7D%0A%0A    public void at_pos_multidim_native(ThreadContext tc, long%5B%5D indices) %7B%0A        if (indices.length != 1)%0A            throw ExceptionHandling.dieInternal(tc, %22A dynamic array can only be indexed with a single dimension%22);%0A        this.at_pos_native(tc, indices%5B0%5D);%0A    %7D%0A%0A    public void bind_pos_multidim_boxed(ThreadContext tc, long%5B%5D indices, SixModelObject value) %7B%0A        if (indices.length != 1)%0A            throw ExceptionHandling.dieInternal(tc, %22A dynamic array can only be indexed with a single dimension%22);%0A        this.bind_pos_boxed(tc, indices%5B0%5D, value);%0A    %7D%0A%0A    public void bind_pos_multidim_native(ThreadContext tc, long%5B%5D indices) %7B%0A        if (indices.length != 1)%0A            throw ExceptionHandling.dieInternal(tc, %22A dynamic array can only be indexed with a single dimension%22);%0A        this.bind_pos_native(tc, indices%5B0%5D);%0A    %7D
 %0A%7D%0A

Implement multi-dim access funcs in VMArray.