<commit_before>augment class Iterator {
    multi method perl(:$limit = 40) {
        # Doing this right is probably beyond mortal dwimmery,
        # and even in simple cases it needs the ability to
        # serialize code to have any hope of producing
        # output like (1, 1, * + * ... *)
        # rather than (1, 1, 2, 3, 5, {???} ... ???).
        # Try to do something useful for debugging, for now.
        my @a = self.batch($limit);
        my $and_more = '';
        $and_more = ', {???} ... ???' if @a == $limit;
        '(' ~ @a.map({ $^a.perl }).join(', ') ~ $and_more ~ ')';
    }

    multi method elems() {
        my $elems = 0;
        while !(self.get ~~ EMPTY) {
            $elems++;
        }
        $elems;
    }

    multi method Seq() {
        Seq.new!STORE(self);
    }

    multi method sort(&by = &infix:<cmp>) {
        self.Seq.sort(&by);
    }
}<commit_msg>added .fmt method to Iterator.pm so that fmt can take Iterators of any form.<commit_after>augment class Iterator {
    multi method perl(:$limit = 40) {
        # Doing this right is probably beyond mortal dwimmery,
        # and even in simple cases it needs the ability to
        # serialize code to have any hope of producing
        # output like (1, 1, * + * ... *)
        # rather than (1, 1, 2, 3, 5, {???} ... ???).
        # Try to do something useful for debugging, for now.
        my @a = self.batch($limit);
        my $and_more = '';
        $and_more = ', {???} ... ???' if @a == $limit;
        '(' ~ @a.map({ $^a.perl }).join(', ') ~ $and_more ~ ')';
    }

    multi method elems() {
        my $elems = 0;
        while !(self.get ~~ EMPTY) {
            $elems++;
        }
        $elems;
    }

    multi method Seq() {
        Seq.new!STORE(self);
    }

    multi method sort(&by = &infix:<cmp>) {
        self.Seq.sort(&by);
    }
    multi method fmt($format='%s', $separator=' ') {
        self.Seq.fmt($format,$separator);
    }
}
{'fraction_non_alphanumeric': 0.17229038854805726, 'fraction_numerical': 0.010224948875255624, 'mean_word_length': 1.8321273516642547, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3178017', 'n_tokens_mistral': 672, 'n_tokens_neox': 634, 'n_words': 190}