<commit_before>my class Capture { # declared in BOOTSTRAP
    # class Capture is Any
    #     has @!list;   # positional parameters
    #     has %!hash;   # named parameters

    method from-args(|c) { c }

    submethod BUILD(:@list, :%hash --> Nil) {
        @list.elems; # force reification of all
        nqp::bindattr(self, Capture, '@!list',
            nqp::getattr(nqp::decont(@list.list), List, '$!reified')
        );
        nqp::bindattr(self,Capture,'%!hash',
          nqp::getattr(nqp::decont(%hash),Map,'$!storage'))
            if nqp::attrinited(nqp::decont(%hash),Map,'$!storage')
    }

    multi method WHICH (Capture:D: --> ValueObjAt:D) {
        my Mu $WHICH := nqp::list_s(nqp::eqaddr(self.WHAT,Capture) ?? 'Capture' !! nqp::unbox_s(self.^name));
        if nqp::isconcrete(@!list) && nqp::elems(@!list) {
            nqp::push_s($WHICH, '|');
            my Mu $iter := nqp::iterator(@!list);
            while $iter {
                my Mu \value = nqp::shift($iter);
                nqp::push_s($WHICH, '(');
                nqp::push_s($WHICH, nqp::unbox_s(value.VAR.WHICH));
                nqp::push_s($WHICH, ')');
            }
        }
        if nqp::isconcrete(%!hash) && nqp::elems(%!hash) {
            nqp::push_s($WHICH, '|');
            for nqp::hllize(%!hash).keys.sort -> str \key {
                nqp::push_s($WHICH, key);
                nqp::push_s($WHICH, '(');
                nqp::push_s($WHICH, nqp::unbox_s(nqp::atkey(%!hash,key).WHICH));
                nqp::push_s($WHICH, ')');
            }
        }<commit_msg>Only bind to @!list in Capture.BUILD if the list given isn't empty<commit_after>my class Capture { # declared in BOOTSTRAP
    # class Capture is Any
    #     has @!list;   # positional parameters
    #     has %!hash;   # named parameters

    method from-args(|c) { c }

    submethod BUILD(:@list, :%hash --> Nil) {
        my Int:D $elems = @list.elems; # force reification of all
        nqp::bindattr(self, Capture, '@!list',
          nqp::getattr(nqp::decont(@list.list), List, '$!reified'))
            if $elems;
        nqp::bindattr(self,Capture,'%!hash',
          nqp::getattr(nqp::decont(%hash),Map,'$!storage'))
            if nqp::attrinited(nqp::decont(%hash),Map,'$!storage')
    }

    multi method WHICH (Capture:D: --> ValueObjAt:D) {
        my Mu $WHICH := nqp::list_s(nqp::eqaddr(self.WHAT,Capture) ?? 'Capture' !! nqp::unbox_s(self.^name));
        if nqp::isconcrete(@!list) && nqp::elems(@!list) {
            nqp::push_s($WHICH, '|');
            my Mu $iter := nqp::iterator(@!list);
            while $iter {
                my Mu \value = nqp::shift($iter);
                nqp::push_s($WHICH, '(');
                nqp::push_s($WHICH, nqp::unbox_s(value.VAR.WHICH));
                nqp::push_s($WHICH, ')');
            }
        }
        if nqp::isconcrete(%!hash) && nqp::elems(%!hash) {
            nqp::push_s($WHICH, '|');
            for nqp::hllize(%!hash).keys.sort -> str \key {
                nqp::push_s($WHICH, key);
                nqp::push_s($WHICH, '(');
                nqp::push_s($WHICH, nqp::unbox_s(nqp::atkey(%!hash,key).WHICH));
                nqp::push_s($WHICH, ')');
            }
        }
{'fraction_non_alphanumeric': 0.19280843149411037, 'fraction_numerical': 0.0, 'mean_word_length': 2.1761811023622046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2449674', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1128, 'n_words': 182}