Skip to content

Commit 5f959cd

Browse files
committed
Suggest that the feature flag should be called 'list_utils'; reminiscent of the List::Util module name
1 parent b855389 commit 5f959cd

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ppcs/ppc0027-any-and-all.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ Most code of any appreciable size tends to make use of at least the `any` or `al
1919

2020
## Specification
2121

22-
New named features that, when enabled, activate syntax analogous to the existing `grep` operator, named `any` and `all`:
22+
A new named feature that, when enabled, activates new operators analogous to the existing `grep` operator, named `any` and `all`:
2323

2424
```perl
25+
use feature 'list_utils';
26+
2527
any { BLOCK } LIST
2628

2729
all { BLOCK } LIST
@@ -50,17 +52,17 @@ Some::Class->new(
5052

5153
## Backwards Compatibility
5254

53-
As these new operators are guarded by named features, there are no immediate concerns with backward compatiblity in the short-term.
55+
As these new operators are guarded by a named feature, there are no immediate concerns with backward compatiblity in the short-term.
5456

55-
In the longer term, if these named features become part of a versioned feature bundle that is enabled by a corresponding `use VERSION` declaration there may be concerns that the names collide with functions provided by `List::Util` or similar modules. As the intention of these operators is to provide the same behaviour, this is not considered a major problem. Differences due to caller scope as outlined above may be surprising to a small number of users.
57+
In the longer term, if this named feature becomes part of a versioned feature bundle that is enabled by a corresponding `use VERSION` declaration there may be concerns that the names collide with functions provided by `List::Util` or similar modules. As the intention of these operators is to provide the same behaviour, this is not considered a major problem. Differences due to caller scope as outlined above may be surprising to a small number of users.
5658

5759
## Security Implications
5860

5961
## Examples
6062

6163
```perl
6264
use v5.40;
63-
use feature 'any';
65+
use feature 'list_utils';
6466

6567
if( any { $_ > 10 } 5, 10, 15, 20 ) { say "A number above 10" }
6668
```
@@ -114,10 +116,6 @@ In any case, as junctions behave like values, they do not require special syntax
114116

115117
## Open Issues
116118

117-
* There could be anything up to five new operators added by this idea. Do they all get their own named feature flags? Do they all live under one flag?
118-
119-
* Should the flag be called `any`? That might be confusing as compared to the `:any` import tag which would request all features.
120-
121119
## Copyright
122120

123121
Copyright (C) 2024, Paul Evans.

0 commit comments

Comments
 (0)