Re: Straw poll: Naming for `*any()` and `*all()` on iterables
| From: | tyson andre | Date: | Sun, 17 Jan 2021 14:45:50 +0000 |
| Subject: | Re: Straw poll: Naming for `*any()` and `*all()` on iterables | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112913@lists.php.net to get a copy of this message | ||
Hi internals,
> > I've created a straw poll for the naming pattern to use for
> >
*any() and *all() on iterables.
> > https://wiki.php.net/rfc/any_all_on_iterable_straw_poll
> >
> > Background: The RFC
> > https://wiki.php.net/rfc/any_all_on_iterable proposes adding only
> > two functions,
> > but more functionality acting on iterables (array|Traversable) may be added in the future,
> > making it important to get feedback what people feel the best choice of naming pattern
> > would be
> > to avoid inconsistency or name changes later on.
> > (Many alternatives were suggested in the initial RFC announcement -
> > https://externals.io/message/111756)
>
> > From Nikita Popov,
> > Using just the SPL namespace (that is, SPL\any) makes the SPL namespace a
> > dumping ground for everything, as you said. Once you introduce an
> > additional meaningful namespace in the form of SPL\iterable\any, you are
> > better off either dropping the SPL part and arriving at iterable\any, or
> > replacing SPL with something more sensible and arriving at PHP\iterable\any.
> >
> > TBH I think Tyson's original approach of not including namespaces as a
> > possibility was the right one. We clearly still don't have any consensus on
> > how to structure namespaces in PHP extensions and it doesn't seem like a
> > question that should be resolved as a footnote of another RFC. There have
> > been multiple RFCs one the topic, and none of them reached anything even
> > approaching a consensus.
>
> I'm planning to revise
> https://wiki.php.net/rfc/any_all_on_iterable_straw_poll_namespace
> due to feedback that the proposed namespace choices differs from prior proposals
> such as https://wiki.php.net/rfc/php_namespace_policy and
> perceived interest in options such as PHP\SubNS\
>
> Although my original intent was to add *any*() and
> *all*() to the language
> rather than work on PHP namespace policy,
> I still feel obligated to gather feedback for this specific use case
> since this discussion may come up in future RFCs adding new categories of functionality.
>
> There'd be an unmanageable amount of options to vote among if I poll on the combination of
> namespace and name,
> which is even more unpleasant since we currently don't have a widget dedicated to
> STV(Single Transferrable Vote) polls (that I know of),
> just forms that must be submitted individually.
> (e.g. is X\iter\any_value() preferable over X\iterable_any())
>
> - Additionally, we haven't yet determined if there's a consensus on namespaces.
>
> My plan is to start a different STV straw poll, on
>
> - no namespace: iterable_any()/iterable_all()
> - iter\ (conflicts with nikic/iter but was also suggested by Nikita)
> - iterable\ (see below note)
> - PHP\ (This deliberately uses uppercase, see
> https://www.php.net/manual/en/language.namespaces.rationale.php)
> - PHP\iter\
> - PHP\iterable\ (see below note)
> - Ext\Spl\, as suggested in
> https://wiki.php.net/rfc/php_namespace_policy
> - Spl\
> - Spl\iter\
> - Spl\iterable\ (see below note)
>
> And if there's a clear preference for a namespace, start a second STV straw poll between
> iterable_any(), NS\any(), NS\any_value, NS\iterable_any(), for the preferred namespace.
I've updated https://wiki.php.net/rfc/any_all_on_iterable_straw_poll_namespace
to be a vote on the namespace choice rather than only Spl\ options.
I plan to start voting on that straw poll in a few days, with the vote left open for 2 weeks.
If there's a clear preference for a namespace, I plan to start a second STV straw poll between
iterable_any(), NS\any(), NS\any_value, and NS\iterable_any() (if appropriate), for the preferred
namespace.
Thanks,
- Tyson