<commit_before># this is actually part of the Array class

    my role ShapedArray does Rakudo::Internals::ShapedArrayCommon {
        has $.shape;

        # Handle dimensions > 3 or more indices than dimensions.
        # If dimensions <= 3, then custom AT-POS should have caught
        # correct number of indices already.
        multi method AT-POS(::?CLASS:D: **@indices) is raw {
            nqp::stmts(
              (my \reified := nqp::getattr(self,List,'$!reified')),
              nqp::if(
                nqp::islt_i(
                  @indices.elems,                    # reifies
                  (my int $numdims = nqp::numdimensions(reified))
                ),
                X::NYI.new(
                  feature => "Partially dimensioned views of shaped arrays").throw,
                nqp::stmts(
                  (my \indices := nqp::getattr(@indices,List,'$!reified')),
                  (my \idxs := nqp::list_i),
                  nqp::while(                        # native index list
                    nqp::isge_i(($numdims = nqp::sub_i($numdims,1)),0),
                    nqp::push_i(idxs,nqp::shift(indices))
                  ),
                  (my \element := nqp::ifnull(
                    nqp::atposnd(reified,idxs),      # found it
                    nqp::p6scalarfromdesc(
                      ContainerDescriptor::BindArrayPosND.new(
                        nqp::getattr(array, Array, '$!descriptor'),
                        reified, idxs
                      )
                    )
                  )),
                  nqp::if(
                    nqp::elems(indices),
                    element.AT-POS(|@indices),       # index further
                    element                          # we're done!
                  )
                )
              )
            )
        }

        multi method ASSIGN-POS(::?CLASS:D: **@indices-value) {
            nqp::stmts(
              (my \value   := @indices-value.pop),   # reifies
              (my \indices := nqp::getattr(@indices-value,List,'$!reified')),
              (my \reified := nqp::getattr(self,List,'$!reified')),
              nqp::if(
                nqp::isge_i(<commit_msg>Use the actual object instance instead of a type object<commit_after># this is actually part of the Array class

    my role ShapedArray does Rakudo::Internals::ShapedArrayCommon {
        has $.shape;

        # Handle dimensions > 3 or more indices than dimensions.
        # If dimensions <= 3, then custom AT-POS should have caught
        # correct number of indices already.
        multi method AT-POS(::?CLASS:D: **@indices) is raw {
            nqp::stmts(
              (my \reified := nqp::getattr(self,List,'$!reified')),
              nqp::if(
                nqp::islt_i(
                  @indices.elems,                    # reifies
                  (my int $numdims = nqp::numdimensions(reified))
                ),
                X::NYI.new(
                  feature => "Partially dimensioned views of shaped arrays").throw,
                nqp::stmts(
                  (my \indices := nqp::getattr(@indices,List,'$!reified')),
                  (my \idxs := nqp::list_i),
                  nqp::while(                        # native index list
                    nqp::isge_i(($numdims = nqp::sub_i($numdims,1)),0),
                    nqp::push_i(idxs,nqp::shift(indices))
                  ),
                  (my \element := nqp::ifnull(
                    nqp::atposnd(reified,idxs),      # found it
                    nqp::p6scalarfromdesc(
                      ContainerDescriptor::BindArrayPosND.new(
                        nqp::getattr(self, Array, '$!descriptor'),
                        reified, idxs
                      )
                    )
                  )),
                  nqp::if(
                    nqp::elems(indices),
                    element.AT-POS(|@indices),       # index further
                    element                          # we're done!
                  )
                )
              )
            )
        }

        multi method ASSIGN-POS(::?CLASS:D: **@indices-value) {
            nqp::stmts(
              (my \value   := @indices-value.pop),   # reifies
              (my \indices := nqp::getattr(@indices-value,List,'$!reified')),
              (my \reified := nqp::getattr(self,List,'$!reified')),
              nqp::if(
                nqp::isge_i(
{'fraction_non_alphanumeric': 0.1220995719756702, 'fraction_numerical': 0.0022527596305474207, 'mean_word_length': 1.215568862275449, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6310937', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1174, 'n_words': 240}