<commit_before>role Positional[::T = Mu] {
    our multi method postcircumfix:<[ ]>() { self.list }

    our multi method postcircumfix:<[ ]>(&block) { self[&block(self.elems)]; }

    our multi method postcircumfix:<[ ]>($x) { self[$x.Int]; }

    our multi method postcircumfix:<[ ]>(@index) {
        Q:PIR {
            .local pmc result, self, flat
            result = root_new ['parrot';'ResizablePMCArray']
            self = find_lex 'self'
            $P0 = find_lex '@index'
            $P0 = $P0.'flat'()
            flat = $P0.'eager'()
          loop:
            unless flat goto done
            $P0 = shift flat
            $P0 = '!postcircumfix:<[ ]>'(self, $P0)
            push result, $P0
            goto loop
          done:
            %r = '&infix:<,>'(result :flat)
        }
    }

    our multi method postcircumfix:<[ ]>(Int $index) {
        fail "Cannot use negative index $index on {self.WHO}" if $index < 0;
        Q:PIR {
            .local pmc self, index
            self  = find_lex 'self'
            index = find_lex 'index'
            $I0   = index
            %r    = self[index]
            unless null %r goto done
            %r    = new ['Perl6Scalar']
          done:
        }
    }

    method of() {
        T
    }
}
<commit_msg>Back out change to Positional -- we'll have to work out something else for non-Rakudo objects.<commit_after>role Positional[::T = Mu] {
    our multi method postcircumfix:<[ ]>() { self.list }

    our multi method postcircumfix:<[ ]>(&block) { self[&block(self.elems)]; }

    our multi method postcircumfix:<[ ]>($x) { self[$x.Int]; }

    our multi method postcircumfix:<[ ]>(@index) {
        Q:PIR {
            .local pmc result, self, flat
            result = root_new ['parrot';'ResizablePMCArray']
            self = find_lex 'self'
            $P0 = find_lex '@index'
            $P0 = $P0.'flat'()
            flat = $P0.'eager'()
          loop:
            unless flat goto done
            $P0 = shift flat
            $P0 = '!postcircumfix:<[ ]>'(self, $P0)
            push result, $P0
            goto loop
          done:
            %r = '&infix:<,>'(result :flat)
        }
    }

    method of() {
        T
    }
}

{'fraction_non_alphanumeric': 0.1437584497521406, 'fraction_numerical': 0.008562415502478594, 'mean_word_length': 1.6272189349112427, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 16, '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': '1422728', 'n_tokens_mistral': 741, 'n_tokens_neox': 715, 'n_words': 192}