<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 str $WHICH = nqp::istype(self.WHAT,Capture)
          ?? 'Capture'
          !! self.^name;
        if !nqp::isnull(@!list) && @!list {
            $WHICH ~= '|';
            for nqp::hllize(@!list) -> \elem {
                $WHICH ~= ( '(' ~ elem.VAR.WHICH ~ ')' )
            }
        }
        if !nqp::isnull(%!hash) && %!hash {
            $WHICH ~= '|';
            $WHICH ~= ( $_ ~ '(' ~ nqp::atkey(%!hash, nqp::unbox_s($_)).WHICH ~ ')' )
              for nqp::hllize(%!hash).keys.sort;
        }
        nqp::box_s($WHICH,ValueObjAt)
    }

    multi method AT-KEY(Capture:D: Str:D \key) is raw {
        nqp::if(
          (nqp::isnull(%!hash) || !nqp::defined(%!hash)),<commit_msg>Fix Capture.WHICH for subclasses of Capture<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) {
        @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 str $WHICH = nqp::eqaddr(self.WHAT,Capture) ?? 'Capture' !! self.^name;
        if !nqp::isnull(@!list) && @!list {
            $WHICH ~= '|';
            for nqp::hllize(@!list) -> \elem {
                $WHICH ~= ( '(' ~ elem.VAR.WHICH ~ ')' )
            }
        }
        if !nqp::isnull(%!hash) && %!hash {
            $WHICH ~= '|';
            $WHICH ~= ( $_ ~ '(' ~ nqp::atkey(%!hash, nqp::unbox_s($_)).WHICH ~ ')' )
              for nqp::hllize(%!hash).keys.sort;
        }
        nqp::box_s($WHICH,ValueObjAt)
    }

    multi method AT-KEY(Capture:D: Str:D \key) is raw {
        nqp::if(
          (nqp::isnull(%!hash) || !nqp::defined(%!hash)),
{'fraction_non_alphanumeric': 0.19832605531295489, 'fraction_numerical': 0.0, 'mean_word_length': 2.156142365097589, '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': '5411886', 'n_tokens_mistral': 1007, 'n_tokens_neox': 979, 'n_words': 164}