<commit_before>my role Signal::Signally {
    multi method CALL-ME(Int() $signum) { $signum ?? (nextsame) !! self }
}
my enum Signal does Signal::Signally ( |do {
        my $res  := nqp::list;
        my $iter := nqp::iterator(nqp::getsignals);
        nqp::push(
          $res,
          Pair.new(nqp::shift($iter), nqp::abs_i(nqp::shift($iter)))
        ) while $iter;
        $res
    }
);

proto sub signal(|) {*}
multi sub signal(*@signals, :$scheduler = $*SCHEDULER) {
    if @signals.grep( { !nqp::istype($_,Signal) } ) -> @invalid {
        die "Found invalid signals: @invalid.join(', ')"
    }

    # 0: Signal not supported by host, Negative: Signal not supported by backend
    sub unsupported($desc, $name, @sigs --> Nil) {
        warn "The following signals are not supported on this $desc ($name): @sigs.join(', ')";
    }
<commit_msg>Don't use nqp::iterator on nqp::getsignals<commit_after>my role Signal::Signally {
    multi method CALL-ME(Int() $signum) { $signum ?? (nextsame) !! self }
}
my enum Signal does Signal::Signally ( BEGIN |do {
    my $res     := nqp::list;
    my $signals := nqp::clone(nqp::getsignals);
    nqp::while(
      nqp::elems($signals),
      nqp::push(
        $res,
        Pair.new(nqp::shift($signals), nqp::abs_i(nqp::shift($signals)))
      )
    );
    $res
});

proto sub signal(|) {*}
multi sub signal(*@signals, :$scheduler = $*SCHEDULER) {
    if @signals.grep( { !nqp::istype($_,Signal) } ) -> @invalid {
        die "Found invalid signals: @invalid.join(', ')"
    }

    # 0: Signal not supported by host, Negative: Signal not supported by backend
    sub unsupported($desc, $name, @sigs --> Nil) {
        warn "The following signals are not supported on this $desc ($name): @sigs.join(', ')";
    }

{'fraction_non_alphanumeric': 0.17697107203630175, 'fraction_numerical': 0.0011344299489506524, 'mean_word_length': 3.0551724137931036, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2189370', 'n_tokens_mistral': 624, 'n_tokens_neox': 598, 'n_words': 155}