<commit_before>package _5curry; 

use B qw(svref_2object);

BEGIN {
    require Exporter;
    our $VERSION = 0.1;
    our @ISA = qw(Exporter);
    our @EXPORT = qw(makecurry);
}

sub curry {
    my $f = shift;
    my $args = \@_;
    sub { $f->(@$args, @_) }
}

sub makecurry {
    no strict 'refs';
    my $f = shift;
    my $cv = svref_2object($f);
    my $rawname = $cv->GV->NAME;
    my ($fname, $pkg) = ($rawname .'_5c', caller);
    my $success = 1;
    if (*$fname{CODE}) {
        $success = 0;
    } else {
        *{$pkg."::$fname"} = curry(\&curry, $f);
    }
    $success
}

1<commit_msg>Currying by names. Fix: symbol check.<commit_after>package _5curry; 

use B qw(svref_2object);

BEGIN {
    require Exporter;
    our $VERSION = 0.1;
    our @ISA = qw(Exporter);
    our @EXPORT = qw(makecurry);
}

sub curry {
    my $f = shift;
    my $args = \@_;
    sub { $f->(@$args, @_) }
}

sub makecurry {
    no strict 'refs';
    my $f = shift;
    my $cv = svref_2object($f);
    my $rawname = $cv->GV->NAME;
    my ($fname, $pkg) = ($rawname .'_5c', caller);
    my $success = 1;
    if (*{$pkg."::$fname"}{CODE}) {
        $success = 0;
    } else {
        *{$pkg."::$fname"} = curry(\&curry, $f);
    }
    $success
}

1
{'fraction_non_alphanumeric': 0.19676113360323888, 'fraction_numerical': 0.014574898785425101, 'mean_word_length': 2.3136729222520107, 'pattern_counts': {'":': 3, '<': 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': '3976921', 'n_tokens_mistral': 527, 'n_tokens_neox': 511, 'n_words': 122}