
package Text::Wigwam::Stash::Base::Metachar::Array;

use strict;
use warnings;
no warnings q/uninitialized/;

use base 'Text::Wigwam::Stash::Base::Metachar';

our $VERSION = '0.01';

sub get {
    my ($self, $mgc, $aref, $key) = @_;
    $key =~ s/\\(.)/$1/g;
    return( $aref->[$key], \$aref->[$key] );
}

sub set {
    my ($self, $mgc, $aref, $key, $type, $def) = @_;
    my $v;
    $key =~ s/\\(.)/$1/g;
    return ( $type, $v )
     if defined($v = $aref->[$key]);
    return ( $type, $aref->[$key] = $def ); # Vivify
}

sub def {
    my ($self, $mgc, $aref, $key) = @_;
    $key =~ s/\\(.)/$1/g;
#    return unless defined $aref->[$key];
    return $self->_ref_rref ( $aref->[$key] );
}


1;
