rfc:cachediterable_straw_poll

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:cachediterable_straw_poll [2021/06/05 00:24] tandrerfc:cachediterable_straw_poll [2021/06/05 16:40] tandre
Line 1: Line 1:
 ====== PHP RFC: Straw poll: Namespace to use for CachedIterable and iterable functionality ====== ====== PHP RFC: Straw poll: Namespace to use for CachedIterable and iterable functionality ======
-  * Version: 0.1+  * Version: 0.2
   * Date: 2021-06-01   * Date: 2021-06-01
   * Author: Tyson Andre, <tandre@php.net>   * Author: Tyson Andre, <tandre@php.net>
Line 17: Line 17:
 In particular, https://wiki.php.net/rfc/namespaces_in_bundled_extensions#core_standard_spl and https://wiki.php.net/rfc/namespaces_in_bundled_extensions#existing_non-namespaces_symbols_and_consistency can be interpreted in different ways - the RFC recommends the usage of namespaces for functionality in core, but permits functionality to use the global namespace if it would be consistent with similar non-namespaced functionality already in core/standard/spl. In particular, https://wiki.php.net/rfc/namespaces_in_bundled_extensions#core_standard_spl and https://wiki.php.net/rfc/namespaces_in_bundled_extensions#existing_non-namespaces_symbols_and_consistency can be interpreted in different ways - the RFC recommends the usage of namespaces for functionality in core, but permits functionality to use the global namespace if it would be consistent with similar non-namespaced functionality already in core/standard/spl.
  
-In addition to that, because this says "may" and "should" instead of "must", there +In addition to that, because that RFC says "may" and "should" instead of "must", it can be interpreted differently by different people. (I am assuming those words meant something similar to https://datatracker.ietf.org/doc/html/rfc2119 but that was not specified in the namespaces in bundled extensions RFC)
  
 ===== Proposal ===== ===== Proposal =====
  
-Create a straw poll for the functionality from [[rfc:cachediterable|CachedIterable]] and successors to the [[rfc:any_all_on_iterable|any() and all() on iterables]] RFC: [[https://github.com/php/php-src/pull/6053|any()/all()/none()/find()/reduce()]]+In this straw poll, gather feedback for the functionality from [[rfc:cachediterable|CachedIterable]] and successors to the [[rfc:any_all_on_iterable|any() and all() on iterables]] RFC: [[https://github.com/php/php-src/pull/6053|any()/all()/none()/find()/reduce()]]
  
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
Line 28: Line 28:
 If you are opposed to this functionality being added to PHP in any form, please note this in addition to your preferred namespacing choice, given that https://wiki.php.net/rfc/namespaces_in_bundled_extensions has passed. If you are opposed to this functionality being added to PHP in any form, please note this in addition to your preferred namespacing choice, given that https://wiki.php.net/rfc/namespaces_in_bundled_extensions has passed.
  
-https://wiki.php.net/rfc/namespaces_in_bundled_extensions strongly discourages some of the previously considered options+==== Namespace choices ==== 
 + 
 +https://wiki.php.net/rfc/namespaces_in_bundled_extensions strongly discourages some of the previously considered namespace options with too few or too many namespace parts.
  
 <blockquote> <blockquote>
Line 70: Line 72:
 \\ \\
  
-Functionality of interest in the successor to the [[rfc:any_all_on_iterable|any() and all() on iterables]] RFC: [[https://github.com/php/php-src/pull/6053|any()/all()/none()/find()/reduce()]]+Functionality of interest in the successor to the [[rfc:any_all_on_iterable|any() and all() on iterables]] RFC:  
 + 
 +[[https://github.com/php/php-src/pull/6053|Implementation of any()/all()/none()/find()/reduce()]]
  
 (functionality such as ''reversed()'', ''flip(iterable): CachedIterable'', etc. (which would require ''CachedIterable'') is left out of this question) (functionality such as ''reversed()'', ''flip(iterable): CachedIterable'', etc. (which would require ''CachedIterable'') is left out of this question)
  
-(in this proposal, find() and reduce() act only on values of iterables. Passing too many arguments is currently an error for internal functions and it is possible that it would be deprecated for user-defined functions in the future.)+(in this proposal, find() and reduce() act only on values of iterables, similar to how [[http://php.net/array_reduce|array_reduce]] works. Passing too many arguments is currently an error for internal functions and it is possible that it would be deprecated for user-defined functions in the future.)
  
-<doodle title="Global functions I would want to add to PHP to act on iterables as described" auth="tandre" votetype="multi" closed="true">+<doodle title="Global functions I would want to add to PHP to act on iterables as described in implementation link" auth="tandre" votetype="multi" closed="true">
    * any(...)/all(iterable $input, $callback = null): bool    * any(...)/all(iterable $input, $callback = null): bool
    * none(...): bool    * none(...): bool
Line 82: Line 86:
    * reduce(iterable $input, $callback, $initial = null): mixed    * reduce(iterable $input, $callback, $initial = null): mixed
    * Still too small in scope    * Still too small in scope
 +</doodle>
 +
 +==== Preferred namespace case to use for iterable/Iterable ====
 +
 +I didn't notice this earlier, but the [[rfc:https://namespaces_in_bundled_extensions|Namespaces in Bundled Extensions RFC]] recommended (but didn't mandate) that "Namespace names should follow CamelCase." - so I'm not sure if ''iterable\'' or ''Iterable\'' makes the most sense to others.
 +
 +This poll asks whether ''iterable\'' or ''Iterable\'' makes more sense - It could be argued by some that namespaces such as ''iterable\'' should be an exception due to it also being used as a soft reserved keyword that is typically lowercase.
 +
 +https://externals.io/message/114687#114689
 +
 +<blockquote>
 +To me, a lower-case namespace like "iterable" just looks wrong, because
 +I'm so used to namespaces, like classes, being UpperCamels.
 +
 +The connection to a keyword doesn't seem convincing to me - if anything,
 +it highlights the possible confusion from choosing a namespace name that
 +has a different meaning elsewhere, although I admit no brilliant
 +alternatives spring to mind.
 +
 +Regards,
 +
 +--
 +Rowan Tommins
 +[IMSoP]
 +</blockquote>
 +
 +(Aside: shorter namespace names such as iter were unpopular in a [[rfc:any_all_on_iterable_straw_poll_namespace|previous straw poll]], and iter would conflict with https://github.com/nikic/iter)
 +
 +<doodle title="Preferred namespacing for iterable\" auth="tandre" votetype="single" closed="true">
 +   * iterable\ (lowercase)
 +   * Iterable\ (camel case)
 </doodle> </doodle>
  
 ===== References ===== ===== References =====
-https://externals.io/message/114687 "Namespaces in bundled extensions" and iterable additions to the standard library+ 
 +  * https://externals.io/message/114687 "Namespaces in bundled extensions" and iterable additions to the standard library 
 +  * https://wiki.php.net/rfc/namespaces_in_bundled_extensions 
 +  * https://wiki.php.net/rfc/any_all_on_iterable_straw_poll_namespace
rfc/cachediterable_straw_poll.txt · Last modified: 2021/06/13 14:33 by tandre