Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112594 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94454 invoked from network); 22 Dec 2020 15:54:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Dec 2020 15:54:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8ABA41804D1 for ; Tue, 22 Dec 2020 07:27:33 -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 NAM02-SN1-obe.outbound.protection.outlook.com (mail-oln040092005105.outbound.protection.outlook.com [40.92.5.105]) (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 ; Tue, 22 Dec 2020 07:27:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ChQs3aSriMKjqfa4GioPSiWfc618cNPIgj5l8rYguIWoSzUB/OGvzRcNZmTjisWLdBMESaQiBESIDQk9RJpYV4jFediK7MFHvdtShgCwJ5gP+vqtYZlSCkaWizcUslXcjIHKbOphOrOs+bcX9OM/XWXwb2E9LkuRIAWIQG7dB/lTGb9tZRAfBob2EnydHifSrcNP9njFM9PJht0CfCiVg+3AbdlIKT69CIdStdVM4Ri1x7suORAsdbFsnOgXvJjogrES0KXQqS+h+6Kts9+uZQn9jzE16aPO4n2J3dDpjNQWiNFQg+Kevd8WsakTVn5csj2wxq3zIn/eLLNVaKACpA== 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=52G6jnMLNQysIk/TLxpiCN/gCWAtEcu22fjY94GqWdw=; b=Ydw6TjYm+00moZVQ3JTZV3AztGlXcySkwU7UZP2WxR3tvEjr4yiNpAwfytUK5tkZvl8t/DEcZuV/A3ipkVMZmlggN5qquVKS1J8alRJaVnzLMNamgsoqhCzytl+CQwcZ9UXLSad2xEp9ozRtqblXQZ0qwDyqviRNtqfyyv648JAsu+uvmujRPNb5Ug7FtfR2vdUp30mxosODsCKb3f3cMPsIp8Svf9SmE4zKpMxgaUag4MK9s4/EJbV2Dtrjr1CVSacWyydlh/GJdbL95Me8NPDIzZp/tMPOkZLaEabyIKdwr2F5kcCVSCjQ/okFXWfYEzBCk7d0GjZccYvLaKudmg== 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=52G6jnMLNQysIk/TLxpiCN/gCWAtEcu22fjY94GqWdw=; b=dhlaUgg+w9xmHtyDbJfmS91FE79vKt2qxV5LxP+07z7c/rGQnKtfZYFSbogGfL4SYPgz8YQ/I0xm1RKBXkWdxklWBLCtLpo/nofV8wtcEXiSxFlRFxrYhiQ9CTa6kVHEKgISkoJHmQhuUsFFjqImsbjdM6cDUwi5+3DvU28HMvQn/wWp/rGFnIB1sV6oP0o3Y+Vl3wUseXbr44cMmLJEXMe25I/AUMPRJxAEZZAwMc7lhAYeYr2Zqr7fJsjVDGTYk4dNOmWQb7/IY91bNlfIgDXHnJ42Vpo8P8rvqa7elG2OaJmJT1K9zX112VolSNmuwGPmY8nyJiZvH4ugfVEKoQ== Received: from BL2NAM02FT056.eop-nam02.prod.protection.outlook.com (10.152.76.53) by BL2NAM02HT128.eop-nam02.prod.protection.outlook.com (10.152.76.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.25; Tue, 22 Dec 2020 15:27:30 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:7e46::43) by BL2NAM02FT056.mail.protection.outlook.com (2a01:111:e400:7e46::477) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.25 via Frontend Transport; Tue, 22 Dec 2020 15:27:30 +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.3676.033; Tue, 22 Dec 2020 15:27:30 +0000 To: Pierre , Sara Golemon CC: "internals@lists.php.net" Thread-Topic: [PHP-DEV] Straw poll: Naming for `*any()` and `*all()` on iterables Thread-Index: AQHW1kOROymHHd+jAEaQQL1oN/KEl6oB0/yAgAB0iVaAAHWXgIAAfd/y Date: Tue, 22 Dec 2020 15:27:30 +0000 Message-ID: References: ,<477208c5-331d-671e-a8f4-199a751f0a04@processus.org> In-Reply-To: <477208c5-331d-671e-a8f4-199a751f0a04@processus.org> Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:8800327BB401551496096DABB38A4CBF0C19695A4FA5F38E2C462FC32EED4A40;UpperCasedChecksum:F720E15CC844551A222EA3BC8877E383C84EC39BDF8B46A6376D27353E279265;SizeAsReceived:7360;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [W8Ey54sX5e2qr53xvhxSZeZBIDrn9JWloRwipIL4jKRTn7a4iskt55RgPVN304qw] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: f44ecfc3-e056-4a35-2384-08d8a68e18cd x-ms-traffictypediagnostic: BL2NAM02HT128: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TEK1/NEOSQKrGwtAwrPo4elbTSJyNZtFYClvk6nV71ievcjliEqjZPPT8wDrtRCYV7IuSBO/5lTKEk8SDV/Oaa72JFrnWsfm3fVsGrGUV3VoH1jCypTAXHA9flKjOgY2LnuM5GnG4SYkjR/qO0rs+JQVsXRsJaV4PF5fv5/KqDaUWKvM8ijenT616cl4+o8lBaHOASHdQ0mxEtM0a5lXP5UMz00oZ6ShVQvIddeT8/aYgAIJVwdHrAhCK1IXnljQcQK4eT2wtlbpZTDBrYUMoNgBPLwrGVRHYnfQowJCkF8= x-ms-exchange-antispam-messagedata: R0DvQARzN15FJl9qwkvFDNNmg9Xsgd7QwdqxsNcjjyfCGX25Oj/oO00wnSfvfSIuhBs8jSmFgVWH4oMJ3E/kTofhyMbK1BdiDbz6wCQUO6FiiE7h4HamCmtFSnzxTiON0XDosPYPzbihapB93xhkMeF/aSEgY54mxwS1Bdi/H031aWLDDjAOxWpi2fqg5KULPJzhKW/EhEcnX3yfa0fQRg== 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: BL2NAM02FT056.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: f44ecfc3-e056-4a35-2384-08d8a68e18cd X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Dec 2020 15:27:30.4169 (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: BL2NAM02HT128 Subject: Re: [PHP-DEV] Straw poll: Naming for `*any()` and `*all()` on iterables From: tysonandre775@hotmail.com (tyson andre) Hi Pierre,=0A= =0A= > This is the kind of reasoning I fully support usually, I do maintain a = =0A= > few libraries for multiple PHP versions as most people in this list and = =0A= > make things easily polifyllable is something I'm sensible to.=0A= > =0A= > Nevertheless, the language and its standard library has to evolve at =0A= > some point. For enumerable objects PHP terribly lacks a complete and =0A= > convenient API for developers. By putting those methods in the global =0A= > namespace, you make those methods usage much less fluent for many =0A= > developers that uses a decent IDE. It'd be a great thing to have a =0A= > compete OO-based (interface based) API for collection methods. any() and = =0A= > all() methods are only the start, in my opinion, of much greater =0A= > improvements in that regard, and I'd very much love to have those =0A= > autocompleted by IDE on pretty much everything that is iterable.=0A= > =0A= > That's just an opinion, I'd love to see it evolve towards an =0A= > object-oriented API.=0A= =0A= 1. If you're talking about adding default methods to Traversables,=0A= default method implementations would be a major RFC of their own=0A= for implementation and discussions on guidelines for using them internal= ly.=0A= =0A= It may raise questions such as "why still have both traits and interface= s".=0A= =0A= Some may object to adding too many default methods to the completions fo= r an IDE=0A= or naming conflicts in projects.=0A= 2. I'd find it useful to add, though there may be considerable discussion o= ver what belongs =0A= in an API for collection methods, whether they make sense with SplObject= Storage, etc.=0A= 3. The pipe operator RFC may be a bit more fluent if a revised version is a= ccepted - https://externals.io/message/112558#112574=0A= =0A= `$exists =3D create_collection() |> user_defined_filter($$) |> someprefi= x_any($$)` (possibly different syntax)=0A= =0A= 4. I'd still want to add this functionality for arrays. Limiting any/all to= arrays only would be artificial,=0A= and projects can use both if `->any()` was added by a different RFC =0A= (both count()/Countable->count() syntaxes are used in php code)=0A= =0A= =0A= Thanks,=0A= -Tyson=0A=