package Camila::Variable;

use 5.006;
use strict;
use warnings;

use Camila::String;
use Camila::Set;

require Exporter;

our @ISA = qw(Exporter);

our %variable;

# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.

# This allows declaration	use Camila::Variable ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );

our @EXPORT = qw();
our $VERSION = '0.01';

sub new {
  my $name = shift;
  return bless( +{ variable => $name } )
}

sub define {
  my $name = shift;
  my $value = shift;
  $variable{$name} = $value;
  return new($name);
}

sub value {
  my $var = shift;
  if (exists($variable{$var})) {
    return $variable{$var};
  } else {
    # print STDERR "variable $var undefined!\n";
    return Camila::Set::nill;
  }
}

sub show {
  my $self = shift;
  $self->{variable};
}



1;
__END__

=head1 NAME

Camila::Variable - Perl extension for blah blah blah

=head1 SYNOPSIS

  use Camila::Variable;
  blah blah blah

=head1 DESCRIPTION

Stub documentation for Camila::Variable, created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.

Blah blah blah.

=head1 AUTHOR

Alberto Simões, E<lt>albie@alfarrabio.di.uminho.ptE<gt>

=head1 SEE ALSO

L<perl>.

=cut
