use strict;
use warnings;
-our $VERSION = '0.79';
+our $VERSION = '0.83';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
return sub {
my $caller = $CALLER;
- my $wrapper = $self->_make_wrapper($caller, $sub, $fq_name);
+ my $wrapper = $self->_curry_wrapper($sub, $fq_name, $caller);
my $sub = subname($fq_name => $wrapper);
};
}
-sub _make_wrapper {
+sub _curry_wrapper {
my $class = shift;
- my $caller = shift;
my $sub = shift;
my $fq_name = shift;
+ my @extra = @_;
- my $wrapper = sub { $sub->($caller, @_) };
+ my $wrapper = sub { $sub->(@extra, @_) };
if (my $proto = prototype $sub) {
# XXX - Perl's prototype sucks. Use & to make set_prototype
- # ignore the fact that we're passing a "provate variable"
+ # ignore the fact that we're passing "private variables"
&Scalar::Util::set_prototype($wrapper, $proto);
}
return $wrapper;
sub has_rw {
my ($caller, $name, %options) = @_;
- Class::MOP::Class->initialize($caller)->add_attribute($name,
+ Class::MOP::class_of($caller)->add_attribute($name,
is => 'rw',
%options,
);