my $slot_name = sprintf "'%s'", $attr->slots;
my $inv = '$_[0]';
my $code = 'sub { '
+ . $self->_inline_pre_body($attr)
. 'if (scalar(@_) == 2) {'
. $self->_inline_check_required
. $self->_inline_check_coercion
. $self->_inline_trigger($inv, $value_name)
. ' }'
. $self->_inline_check_lazy
+ . $self->_inline_post_body($attr)
. 'return ' . $self->_inline_auto_deref($self->_inline_get($inv))
. ' }';
my $value_name = $attr->should_coerce ? '$val' : '$_[1]';
my $inv = '$_[0]';
my $code = 'sub { '
+ . $self->_inline_pre_body($attr)
. $self->_inline_check_required
. $self->_inline_check_coercion
. $self->_inline_check_constraint($value_name)
. $self->_inline_store($inv, $value_name)
+ . $self->_inline_post_body($attr)
. $self->_inline_trigger($inv, $value_name)
. ' }';
my $attr_name = $attr->name;
my $code = 'sub {'
+ . $self->_inline_pre_body($attr)
. 'confess "Cannot assign a value to a read-only accessor" if @_ > 1;'
. $self->_inline_check_lazy
+ . $self->_inline_post_body($attr)
. 'return ' . $self->_inline_auto_deref( '$_[0]->{$attr_name}' ) . ';'
. '}';