summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-06-23 19:35:49 -0500
committerJesse Luehrs <doy@tozt.net>2012-06-23 19:35:49 -0500
commit5cbf79a0b419352959fdecb34248f791aaa15a22 (patch)
treeaaa6bfafd46dfb1c1bb0ed3af706782a0a1cc560
parentac8d7eec0033ae938648be9df84fff05f08aae3b (diff)
downloadsmartmatch-5cbf79a0b419352959fdecb34248f791aaa15a22.tar.gz
smartmatch-5cbf79a0b419352959fdecb34248f791aaa15a22.zip
rename to callback_at_level
-rw-r--r--lib/smartmatch.pm4
-rw-r--r--t/sugar.t4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/smartmatch.pm b/lib/smartmatch.pm
index 8cbbc9e..26655b5 100644
--- a/lib/smartmatch.pm
+++ b/lib/smartmatch.pm
@@ -81,14 +81,14 @@ sub unimport {
=head1 FUNCTIONS
-=head2 get_smartmatch_callback($level)
+=head2 callback_at_level($level)
Returns a coderef which will call smartmatching on its two arguments, with the
smartmatch implementation used at caller level C<$level>.
=cut
-sub get_smartmatch_callback {
+sub callback_at_level {
my ($level) = @_;
$level++;
my $hh = (caller($level))[10];
diff --git a/t/sugar.t b/t/sugar.t
index 2dacc9f..f3fe440 100644
--- a/t/sugar.t
+++ b/t/sugar.t
@@ -32,7 +32,7 @@ sub any {
return sub {
my ($lval) = @_;
- my $recurse = smartmatch::get_smartmatch_callback(1);
+ my $recurse = smartmatch::callback_at_level(1);
return List::MoreUtils::any { $recurse->($lval, $_) } @rvals;
}
}
@@ -51,7 +51,7 @@ sub any {
my $self = shift;
my ($lval) = @_;
- my $recurse = smartmatch::get_smartmatch_callback(1);
+ my $recurse = smartmatch::callback_at_level(1);
return List::MoreUtils::all { $recurse->($lval, $_) }
@{ $self->{rvals} };
}