0.04
[gitmo/Moose-Autobox.git] / lib / Moose / Autobox / Array.pm
index 27680b5..ac7cb71 100644 (file)
@@ -1,9 +1,9 @@
 package Moose::Autobox::Array;
 use Moose::Role 'with';
 use Perl6::Junction;
-use autobox;
+use Moose::Autobox;
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 with 'Moose::Autobox::Ref',
      'Moose::Autobox::List',
@@ -36,7 +36,12 @@ sub delete {
 sub shift { 
     my ($array) = @_;    
     CORE::shift @$array; 
-}     
+}    
+
+sub slice {
+    my ($array, $indicies) = @_;
+    [ @{$array}[ @{$indicies} ] ];
+} 
 
 # NOTE: 
 # sprintf args need to be reversed, 
@@ -134,6 +139,11 @@ sub one {
     return Perl6::Junction::One->one(@$array);
 }
 
+## Print
+
+sub print { CORE::print @{$_[0]} }
+sub say   { CORE::print @{$_[0]}, "\n" }
+
 1;
 
 __END__
@@ -147,7 +157,6 @@ Moose::Autobox::Array - the Array role
 =head1 SYNOPOSIS
 
   use Moose::Autobox;
-  use autobox;
     
   [ 1..5 ]->isa('ARRAY'); # true
   [ a..z ]->does('Moose::Autobox::Array'); # true
@@ -179,6 +188,8 @@ This is a role to describe operations on the Array type.
 
 =item B<sprintf ($format_string)>
 
+=item B<slice (@indices)>
+
 =back
 
 =head2 Indexed implementation
@@ -239,6 +250,10 @@ This is a role to describe operations on the Array type.
 
 =item B<meta>
 
+=item B<print>
+
+=item B<say>
+
 =back
 
 =head1 BUGS
@@ -253,7 +268,7 @@ Stevan Little E<lt>stevan@iinteractive.comE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006 by Infinity Interactive, Inc.
+Copyright 2006-2007 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>