package Moose::Autobox::Array;
use Moose::Role 'with';
-use autobox;
+use Perl6::Junction;
+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,
$array->keys->map(sub { [ $_, $array->[$_] ] });
}
+## Junctions
+
+sub all {
+ my ($array) = @_;
+ return Perl6::Junction::All->all(@$array);
+}
+
+sub any {
+ my ($array) = @_;
+ return Perl6::Junction::Any->any(@$array);
+}
+
+sub none {
+ my ($array) = @_;
+ return Perl6::Junction::None->none(@$array);
+}
+
+sub one {
+ my ($array) = @_;
+ return Perl6::Junction::One->one(@$array);
+}
+
1;
__END__
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
=back
+=head2 Junctions
+
+=over 4
+
+=item B<all>
+
+=item B<any>
+
+=item B<none>
+
+=item B<one>
+
+=back
+
=over 4
=item B<meta>
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