1 package Moose::Meta::Method::Accessor::Native::Array::set;
7 $VERSION = eval $VERSION;
8 our $AUTHORITY = 'cpan:STEVAN';
12 with 'Moose::Meta::Method::Accessor::Native::Array::Writer' => {
17 _inline_check_arguments
19 _inline_optimized_set_new_value
25 sub _minimum_arguments { 2 }
27 sub _maximum_arguments { 2 }
29 sub _inline_check_arguments {
32 return $self->_inline_check_var_is_valid_index('$_[0]');
35 sub _adds_members { 1 }
37 sub _potential_value {
38 my ( $self, $slot_access ) = @_;
41 "( do { my \@potential = \@{ ($slot_access) }; \$potential[ \$_[0] ] = \$_[1]; \\\@potential } )";
44 sub _new_members { '$_[1]' }
46 sub _inline_optimized_set_new_value {
47 my ( $self, $inv, $new, $slot_access ) = @_;
49 return "${slot_access}->[ \$_[0] ] = \$_[1]";
53 my ( $self, $slot_access ) = @_;
55 return "return ${slot_access}->[ \$_[0] ];";