Skip to content

Commit bf81de7

Browse files
committed
Rename the 'any' and 'all' features and experimental warnings to 'keyword_any' and 'keyword_all'
This avoids confusion with the `use feature ':all'` ability (As requested by #23104)
1 parent 923e6ee commit bf81de7

File tree

16 files changed

+140
-117
lines changed

16 files changed

+140
-117
lines changed

feature.h

Lines changed: 58 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

keywords.c

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

keywords.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/B/Deparse-core.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ sub testit {
9292
else {
9393
package test;
9494
use subs ();
95-
no warnings qw( experimental::any experimental::all );
95+
no warnings qw( experimental::keyword_any experimental::keyword_all );
9696
import subs $keyword;
9797
$code = "no warnings 'syntax'; no strict 'vars'; sub { ${vars}() = $expr }";
9898
$code = "use feature 'isa';\n$code" if $keyword eq "isa";

lib/feature.pm

Lines changed: 8 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/warnings.pm

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pod/perldelta.pod

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,33 @@ here, but most should go in the L</Performance Enhancements> section.
2727

2828
[ List each enhancement as a =head2 entry ]
2929

30+
=head2 Renamed C<any> and C<all> features to C<keyword_any> and C<keyword_all>
31+
32+
Perl release 5.41.7 introduced two new experimental features, called C<any>
33+
and C<all>, which enable keywords of the same names. Those keywords provide
34+
list-processing operators inspired by the ones from L<List::Util> of the same
35+
name. It was subsequently considered that the names of these two features
36+
are confusingly close to the ability of the C<feature> module to refer to all
37+
of its features by using the C<:all> export tag.
38+
(L<GH #23104|https://github.com/Perl/perl5/issues/23104>).
39+
40+
As a consequence, these feature flags have now been renamed to C<keyword_any>
41+
and C<keyword_all> to avoid this confusion. Likewise, the related
42+
experimental warning flags are also renamed to C<experimental::keyword_any>
43+
and C<experimental::keyword_all>. Apart from these new flag names, the
44+
actual syntax and semantics of these two operators remains unchanged since
45+
their appearance in Perl release 5.41.7.
46+
47+
use v5.40;
48+
use feature 'keyword_all';
49+
no warnings 'experimental::keyword_all';
50+
51+
my @numbers = ...
52+
53+
if(all { $_ % 2 == 0 } @numbers) {
54+
say "All the numbers are even";
55+
}
56+
3057
=head1 Security
3158

3259
XXX Any security-related notices go here. In particular, any security

0 commit comments

Comments
 (0)