rfc:any_all_on_iterable_straw_poll_namespace
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:any_all_on_iterable_straw_poll_namespace [2021/01/17 14:21] – tandre | rfc:any_all_on_iterable_straw_poll_namespace [2021/01/17 14:43] – tandre | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Straw poll: Using namespaces for *any() and *all() on iterables ====== | ====== Straw poll: Using namespaces for *any() and *all() on iterables ====== | ||
- | * Version: 0.1 | + | * Version: 0.2 |
* Date: 2021-01-05 | * Date: 2021-01-05 | ||
* Author: Tyson Andre, tandre@php.net | * Author: Tyson Andre, tandre@php.net | ||
Line 25: | Line 25: | ||
===== Discussion ===== | ===== Discussion ===== | ||
- | ==== Arguments for namespaces | + | ==== Arguments for voting again on namespaces ==== |
https:// | https:// | ||
Line 128: | Line 128: | ||
Mark Randall | Mark Randall | ||
+ | </ | ||
+ | |||
+ | From Nikita Popov: https:// | ||
+ | |||
+ | < | ||
+ | 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, | ||
+ | better off either dropping the SPL part and arriving at iterable\any, | ||
+ | replacing SPL with something more sensible and arriving at PHP\iterable\any. | ||
</ | </ | ||
Line 153: | Line 163: | ||
I've also realized that '' | I've also realized that '' | ||
- | but still include it as an option because it's unlikely to be a problem in practice | + | but still include it as an option because it' |
<code php> | <code php> | ||
Line 159: | Line 169: | ||
php > \iterable\my_any(); | php > \iterable\my_any(); | ||
in my_any() polyfill | in my_any() polyfill | ||
- | php > namespace X { use iterable\my_any; | + | php > namespace X { use iterable\my_any; |
+ | in my_any() polyfill | ||
+ | php > namespace { iterable\my_any(); | ||
in my_any() polyfill | in my_any() polyfill | ||
- | php > namespace W { echo iterable:: | ||
- | W\iterable | ||
+ | |||
+ | |||
+ | php > namespace W { echo iterable:: | ||
+ | W\iterable | ||
php > namespace X { use iterable; } | php > namespace X { use iterable; } | ||
Fatal error: Cannot use iterable as iterable because ' | Fatal error: Cannot use iterable as iterable because ' | ||
+ | php > namespace X { use PHP\iterable; | ||
+ | |||
+ | Fatal error: Cannot use PHP\iterable as iterable because ' | ||
+ | |||
php > namespace X { use iterable as iter; iter\my_any(); | php > namespace X { use iterable as iter; iter\my_any(); | ||
in my_any() polyfill | in my_any() polyfill | ||
Line 180: | Line 198: | ||
**Clicking on vote will only submit your vote for the above question, not for all of them.** You may want to write down your choices to avoid losing track of them. To quickly return to the vote section, click on " | **Clicking on vote will only submit your vote for the above question, not for all of them.** You may want to write down your choices to avoid losing track of them. To quickly return to the vote section, click on " | ||
+ | |||
+ | * no namespace: iterable_any()/ | ||
+ | * iter\ (conflicts with [[https:// | ||
+ | * iterable\ (see [[any_all_on_iterable_straw_poll_namespace# | ||
+ | * PHP\ (see [[# | ||
+ | * PHP\iter\ | ||
+ | * PHP\iterable\ (see [[# | ||
+ | * Ext\Spl, as suggested in https:// | ||
+ | * Spl\ (see [[any_all_on_iterable_straw_poll_namespace# | ||
+ | * Spl\iter\ | ||
+ | * Spl\iterable\ | ||
+ | |||
First choice: | First choice: | ||
Line 395: | Line 425: | ||
- https:// | - https:// | ||
- https:// | - https:// | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | |||
rfc/any_all_on_iterable_straw_poll_namespace.txt · Last modified: 2021/02/03 00:30 by tandre