Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112832 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36522 invoked from network); 10 Jan 2021 17:15:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jan 2021 17:15:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C3A4E1804A7 for ; Sun, 10 Jan 2021 08:53:00 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12olkn2035.outbound.protection.outlook.com [40.92.22.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 10 Jan 2021 08:53:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q9SSLBXp1ZTO1ZmRDryuO6h+M7g01k3n84cxdB/j3u+tRsPdturol9aBq/dQ203hQo4hWhJxOhDiF5cr+bknMgZTcatdlUyIoyTxZ/wg23VCZplpqlkmJD20AapZi9fyYwZGdwsO1gdIXQbHRMPooxabzRiQG5NWDSC6aQoIo2kikXBpz7pe4nrVqhLJwK+l0RtIYpIsGpv5Ip7NTuS3TbmluAu3gSixVy+4W0g7glpog/WlkJv8KuJAtYOfDIxzd2h+pQF+L2WoQD3775LJWy+iFnDJNwkkUGihOZQQWQL+uccSqAya482jn5oxYGDOhfLGqSnQ5C/LkKu7lcJ1Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oqnQRaU2+pdUuShV5HdwQ9K0AI+UqeO7uBtC7rj82tQ=; b=VTXR7t9+2LcYEApZwqRQUOzYj5rUoSPWmroT2g8/ZO+bI6QDeS6hBkGJ/fzjsja4dXoeHBA0HGgiaG6j3mekjMfsQ3H3GAJe66/a0yY3xAoZXt83GWWFDPcw9X0oenPCYIkK3N4aZ98RWWBiIqetX3vXnKEhgSdHRQOPIUdBAcqNtcI8eQtsUq/NNAAlRUtg94jPg82DFIDoVeDwBsSwSv9xNPo9/CRzzKh69C5IdpL8Hlo1OLLpvAPsUwuxbBYs45K8tF6moodQfyBD4OR01Mi1FU4C2SQNGpEUF2AqrNJV/iFcJtihCgKZg1HYnSnfk+UobDFeAK+1clnevT2IJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oqnQRaU2+pdUuShV5HdwQ9K0AI+UqeO7uBtC7rj82tQ=; b=DCHBtz0och37D/jaOuWigh/v2rJdT71lb9GFH9vap+hZOMp+lTxjN4ObqzSBYkF2WQxXAgItQTQiMznMI5Y8vdWHAGYI6CzsvXiNik+YIurU4I3pP3343N6NN2LXXMPmxk6ZacWLVhDRa6Drf8syGcVSiJqYRzXQZGpkEQ3NVrv+1audsM/RgR+MsHNmU3XvewDp8D34H7+FvHm182P6041hjc8S1hbvw3MV4+kFgulUabfDDF4eY01xEhkPo7/u3uTTR36ePX+Xj2cHATi3052cF6Zv8d+LmziIys9M3kdvdnKbufiLU/Fe+aQUPzhDxGv2s9nqVTbDeOLADyJYag== Received: from MW2NAM12FT068.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::41) by MW2NAM12HT037.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.2; Sun, 10 Jan 2021 16:52:58 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:fc65::44) by MW2NAM12FT068.mail.protection.outlook.com (2a01:111:e400:fc65::440) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.2 via Frontend Transport; Sun, 10 Jan 2021 16:52:58 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::b4c4:dc11:5337:821d]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::b4c4:dc11:5337:821d%4]) with mapi id 15.20.3742.012; Sun, 10 Jan 2021 16:52:58 +0000 To: "internals@lists.php.net" Thread-Topic: Straw poll: Naming for `*any()` and `*all()` on iterables Thread-Index: AQHW1kOROymHHd+jAEaQQL1oN/KEl6ohIlm2 Date: Sun, 10 Jan 2021 16:52:58 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:E9FB0997DBCFFDA5E756421CDA46D7A5BFAD15D2B2F9EDD2D3DDACC2E4AF1493;UpperCasedChecksum:693153ABFE416F8063DAB401A18C25278929FF3F09C5592A76093F95E8EF015A;SizeAsReceived:7068;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [m6WPHJDExfcny0eHSspYSyPPK99a8r0MjgwzM/9n53hxny0tDFHqys8Soqw3yCca] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 6ea9fa15-f054-4739-edae-08d8b5882f43 x-ms-traffictypediagnostic: MW2NAM12HT037: x-ms-exchange-minimumurldomainage: externals.io#1652 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dPa8tTYqBmD6CCTF2tIE39m/L3XnOC33qV6tL4224kDbwT6BoKyDFFJxSGJBE1zQ1qyVCmta4qFMUozwSHUvLIEhU+Cj/7UmHOZtH86nPPCQP2vazlhU473JEauebxendQznH4SXqwzN9qZMe6K+E760kOxcZKv5GVUaC2XwyoivGleY1cgXHZR0jyHEMTTwQT4Ak7zpHatCSI2ofW/ozKZy66lRLvwR6dB/fXCaxGbEoLwprl35JJb2l4LqE6/0vXFxwTypOWewutAJWFyNvqqhLtL4fUI6IwC421morCI= x-ms-exchange-antispam-messagedata: soZAKh8hXK8UQ+gXEy+1VK358kkIX2M+izo1Q4syR8KKFM0QU88g7cfPqC/IhJ3ZwB5EDy/14P1bdbJG5qvH8nj589CyfUBt3bW+e8msp05Zz5i6KYe1GQ8ZT5L0XPmWYaDj5b2Ex1fbJkPg2QMITknVWXl652Rmzw1MqvJ2/WZPW+4HWZqpnMh18AqjbjXsOi65m75WBqA4LRZXPQlEhw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: MW2NAM12FT068.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 6ea9fa15-f054-4739-edae-08d8b5882f43 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2021 16:52:58.5316 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2NAM12HT037 Subject: Re: Straw poll: Naming for `*any()` and `*all()` on iterables From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= > I've created a straw poll for the naming pattern to use for `*any()` and = `*all()` on iterables.=0A= > https://wiki.php.net/rfc/any_all_on_iterable_straw_poll=0A= > =0A= > Background: The RFC https://wiki.php.net/rfc/any_all_on_iterable proposes= adding only two functions,=0A= > but more functionality acting on iterables (array|Traversable) may be add= ed in the future,=0A= > making it important to get feedback what people feel the best choice of n= aming pattern would be=0A= > to avoid inconsistency or name changes later on.=0A= > (Many alternatives were suggested in the initial RFC announcement - https= ://externals.io/message/111756)=0A= =0A= > From Nikita Popov,=0A= > Using just the SPL namespace (that is, SPL\any) makes the SPL namespace a= =0A= > dumping ground for everything, as you said. Once you introduce an=0A= > additional meaningful namespace in the form of SPL\iterable\any, you are= =0A= > better off either dropping the SPL part and arriving at iterable\any, or= =0A= > replacing SPL with something more sensible and arriving at PHP\iterable\a= ny.=0A= >=0A= > TBH I think Tyson's original approach of not including namespaces as a=0A= > possibility was the right one. We clearly still don't have any consensus = on=0A= > how to structure namespaces in PHP extensions and it doesn't seem like a= =0A= > question that should be resolved as a footnote of another RFC. There have= =0A= > been multiple RFCs one the topic, and none of them reached anything even= =0A= > approaching a consensus.=0A= =0A= I'm planning to revise https://wiki.php.net/rfc/any_all_on_iterable_straw_p= oll_namespace=0A= due to feedback that the proposed namespace choices differs from prior prop= osals =0A= such as https://wiki.php.net/rfc/php_namespace_policy and perceived interes= t in options such as PHP\SubNS\=0A= =0A= Although my original intent was to add `*any*()` and `*all*()` to the langu= age=0A= rather than work on PHP namespace policy,=0A= I still feel obligated to gather feedback for this specific use case=0A= since this discussion may come up in future RFCs adding new categories of f= unctionality.=0A= =0A= There'd be an unmanageable amount of options to vote among if I poll on the= combination of namespace and name,=0A= which is even more unpleasant since we currently don't have a widget dedica= ted to STV(Single Transferrable Vote) polls (that I know of),=0A= just forms that must be submitted individually.=0A= (e.g. is X\iter\any_value() preferable over X\iterable_any())=0A= =0A= - Additionally, we haven't yet determined if there's a consensus on namespa= ces.=0A= =0A= My plan is to start a different STV straw poll, on=0A= =0A= - no namespace: iterable_any()/iterable_all()=0A= - iter\ (conflicts with nikic/iter but was also suggested by Nikita)=0A= - iterable\ (see below note)=0A= - PHP\ (This deliberately uses uppercase, see https://www.php.net/manual/en= /language.namespaces.rationale.php)=0A= - PHP\iter\=0A= - PHP\iterable\ (see below note)=0A= - Ext\Spl\, as suggested in https://wiki.php.net/rfc/php_namespace_policy= =0A= - Spl\=0A= - Spl\iter\=0A= - Spl\iterable\ (see below note)=0A= =0A= 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(), fo= r the preferred namespace.=0A= =0A= I've also realized that `use prefix\iterable` would be mildly inconvenient = for users of PHP and for tooling for PHP,=0A= but still include it as an option because it's manageable and the non-names= paced prefix `iterable_` was preferred in the previous poll.=0A= =0A= ```=0A= php > namespace W { echo iterable::class; }=0A= W\iterable=0A= =0A= php > namespace X { use iterable; }=0A= =0A= Fatal error: Cannot use iterable as iterable because 'iterable' is a specia= l class name in php shell code on line 1=0A= php > namespace X { use iterable\any; /* using individual functions works *= / }=0A= php > namespace Y { use PHP\iterable; function foo(iterable $x) {}}=0A= =0A= Fatal error: Cannot use PHP\iterable as iterable because 'iterable' is a sp= ecial class name in php shell code on line 1=0A= php > namespace Z { use PHP\iterable as iter; }=0A= php > namespace iterable { echo "can be polyfilled\n"; }=0A= can be polyfilled=0A= ```=0A= =0A= - I don't personally see the need for having "Cannot use iterable as iterab= le" be a fatal error (especially since that token can be used in namespaces= ), =0A= but I'd really prefer avoiding iterable entirely to avoid special case na= mespaces in PHP's standard library.=0A= =0A= It could be argued that the type is in some sense used by any namespace s= o it's permissible to silently allow it.=0A= `namespace W { echo iterable::class; }` is `W\iterable`, so this isn't te= chnically true.=0A= =0A= It'd also be inconsistent to allow `use iterable;` but not `use int;`, bu= t making that change is a separate proposal.=0A= - `use PHP\iterable` would cause some inconvenience, but code can work arou= nd it with `use PHP\iterable as iter;`.=0A= This may cause edge cases in IDEs, automatically generated code changes, = etc.=0A= - The edge cases involved in `iterable` are why I propose iter\ as an addit= ional voting option. =0A= =0A= Thanks,=0A= - Tyson=