Le 17/09/2021 à 04:09, tyson andre a écrit :
Hi internals,
I've created a new RFC https://wiki.php.net/rfc/vector proposing to add `final
class Vector` to PHP.
Hello,
That's nice, and I like it, but like many people I will argue about the
API itself.
One thing is that there's many methods in there that would totally fit
generic collection common interfaces, and in that regard, I'd be very
sad that it would be merged as is.
I think it's taking the problem backwards, I would personally prefer that:
- This RFC introduces the vector into a new Collection namespace, or
any other collection/iterable/enumerable related namespace, that'd
probably become the birth of a later to be standard collection API.
- Start thinking about a common API even if it's for one or two
methods, and propose something that later would give the impulsion for
adding new collection types and extending this in order to be become
something that looks like a really coherent collection API.
If this goes in without regarding the greater plan, it will induce
inconsistencies in the future, when people will try to make something
greater. I'd love having something like DS and nikic/iter fused
altogether into PHP core, as a whole, in a consistent, performant, with
a nice and comprehensive API (and that doesn't require to install
userland dependencies).
I know this vector proposal is not about that, but nevertheless, in my
opinion, it must start preparing the terrain for this, or all other RFC
in the future will only create new isolated data structures and make the
SPL even more inconsistent.
Regards,
--
Pierre
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php