package Moose::Autobox::Array;
use Moose::Role 'with';
use Perl6::Junction;
-use autobox;
+use Moose::Autobox;
-our $VERSION = '0.01';
+our $VERSION = '0.03';
with 'Moose::Autobox::Ref',
'Moose::Autobox::List',
sub shift {
my ($array) = @_;
CORE::shift @$array;
-}
+}
+
+sub slice {
+ my ($array, $indicies) = @_;
+ [ @{$array}[ @{$indicies} ] ];
+}
# NOTE:
# sprintf args need to be reversed,
return Perl6::Junction::One->one(@$array);
}
+## Print
+
+sub print { CORE::print @{$_[0]} }
+sub say { CORE::print @{$_[0]}, "\n" }
+
1;
__END__
=head1 SYNOPOSIS
use Moose::Autobox;
- use autobox;
[ 1..5 ]->isa('ARRAY'); # true
[ a..z ]->does('Moose::Autobox::Array'); # true
print "Squares: " . [ 1 .. 10 ]->map(sub { $_ * $_ })->join(', ');
print [ 1, 'number' ]->sprintf('%d is the loneliest %s');
+
+ print ([ 1 .. 5 ]->any == 3) ? 'true' : 'false'; # prints 'true'
=head1 DESCRIPTION
=item B<sprintf ($format_string)>
+=item B<slice (@indices)>
+
=back
=head2 Indexed implementation
=item B<meta>
+=item B<print>
+
+=item B<say>
+
=back
=head1 BUGS
=head1 COPYRIGHT AND LICENSE
-Copyright 2006 by Infinity Interactive, Inc.
+Copyright 2006-2007 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-=cut
\ No newline at end of file
+=cut