not every piece of functionality has been ported (currying with a
CODEREF is not supported).
-=item C<empty> now means empty, not non-empty
+=item C<empty> is now C<is_empty>, and means empty, not non-empty
Previously, the C<empty> method provided by Arrays and Hashes returned true if
the attribute was B<not> empty (no elements). Now it returns true if the
-attribute B<is> empty.
+attribute B<is> empty. It was also renamed to C<is_empty>, to reflect this.
=item C<find> was renamed to C<first>, and C<first> was renamed to C<head>
};
}
-sub empty : method {
+sub is_empty : method {
my ( $attr, $reader, $writer ) = @_;
return sub {
scalar @{ $reader->( $_[0] ) } ? 0 : 1;
get_option => 'get',
join_options => 'join',
count_options => 'count',
- has_no_options => 'empty',
+ has_no_options => 'is_empty',
sorted_options => 'sort',
}
);
my $count = $stuff->count_options;
print "$count\n"; # prints 4
-=item B<empty>
+=item B<is_empty>
Returns a boolean value indicating whether or not the array has any elements.
'get_option_at' => 'get',
'set_option_at' => 'set',
'num_options' => 'count',
- 'has_no_options' => 'empty',
+ 'has_no_options' => 'is_empty',
'clear_options' => 'clear',
'splice_options' => 'splice',
'sort_options_in_place' => 'sort_in_place',
'get_option_at' => 'get',
'set_option_at' => 'set',
'num_options' => 'count',
- 'has_no_options' => 'empty',
+ 'has_no_options' => 'is_empty',
'clear_options' => 'clear',
'splice_options' => 'splice',
'sort_options_in_place' => 'sort_in_place',
default => sub { [] },
handles => {
'num_options' => 'count',
- 'has_no_options' => 'empty',
+ 'has_no_options' => 'is_empty',
'map_options', => 'map',
'filter_options' => 'grep',
'find_option' => 'first',
$options->handles,
{
'num_options' => 'count',
- 'has_no_options' => 'empty',
+ 'has_no_options' => 'is_empty',
'map_options', => 'map',
'filter_options' => 'grep',
'find_option' => 'first',