package B::Simple::Role::WithValue;
use Moose::Role;

requires 'type';

has 'value' => (
    is       => 'rw',
    isa      => 'Value',
    required => 1,
);

sub pprint {
    my ($self, $indent) = @_;
    $indent ||= '';
    return "${indent}[ " . $self->type . " ]=(" 
         . (blessed($self->value) 
              ? $self->value->pprint 
              : $self->value)
         . ")";
}

sub sexpr {
    my $self = shift;
    "(" 
    . $self->type 
    . " " 
    . (blessed($self->value) 
         ? $self->value->pprint 
         : $self->value)
    . ")"
}

sub perl {
    my $self = shift; 
    $self->value;
}

1;

__END__

=pod

=cut