Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114834 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26524 invoked from network); 12 Jun 2021 15:04:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Jun 2021 15:04:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 02E27180384 for ; Sat, 12 Jun 2021 08:20:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10olkn2049.outbound.protection.outlook.com [40.92.40.49]) (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 ; Sat, 12 Jun 2021 08:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=csmuxz6v17iVys1eZtDUPBSfu+lpHoCDnIy44N+iArdE9dpC9R8ZQ11AUDUeOxPzNcbhTegMmJ+hVCa2G2PUyuswxEJ1I3Gkmz1wxBxuuve7YO3UbiN86J2cPz/OA2VGIKTVFTZtFG1UGz1ea89HALUjYn4eYrqCDFfyVqg8AAFuLftDoo+FABLbFTUc6zHCwAbxxxz7TFszaoNR9Towayre7CtekeIlBUFws6fZR/DLQEAyGu4hru0bJV6LrU7MG6+3H6NcwXzIAmFC5+LRYncYUntartFGt+Fn0ZvslTY1WWyQPKAQQpIlbURX9ZBJwUHxjR8KiUr5P4VY7eWH4A== 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=r9SE4rP/FNykt0iqNwi+By6QVvuklulHhEcThIvpUj4=; b=VthmxhI3EgCt3aN8GzjZx9Pr0OnQ8nIoojK8VwrzMrIZrPWwosRTpaJ4ZAIzW93xtAsbqQfDGrGXXbEVE/rodWlc89TfBpzPsb5Cqv+YpNoaUAdy0m4Vwanks9y2frcnKkqg9ViIPfbNlVynNBaNiwvJnSRkUdBwSXb9AJ4LpU9lLkTpm8kNobDqiGo4bgzApUE56biFHhYzW7Qjfd+lSEzvZ9tppmBP9mDIG8pztcEz0egDR/afFaN4n+w1VUnUaU+n3cSrah8pfS94VW+SBnR/oicD7awoZsZAmX4tKDO4B4rgcyr2IdFmm2VH2ANG7HJOT3JvTd/H4LluOBLnAg== 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=r9SE4rP/FNykt0iqNwi+By6QVvuklulHhEcThIvpUj4=; b=YijtvfOSvCywUWjXxuqfkF2iDrMSEjpOrYc5Juezd6QfwwdqieRzLyNPJ6fjAoqS21Z9RjOPhmWLvB6xVti63DpTPMDUgzbpsKsY9IeJD9QPhFvGJoWCouJ6tkuPltl7qe7f8luFH4+qy/s3ARwWkP2lZ1TWNBlbuxnVK8c2zxhMtYur8ryhjcCmS+xaTwvyx3r3fxczS/aKyPlCviammqycGeX++5Ph3tWUDQufqbqD5BuQ61IcZluGIC1AtjzBhGyds2b5yN+ev4wL5sPxoci7sbosgGeTSP7XSlklPLq72QGKYaRP/J7t9NEDskR51zMuZvQNJ74pmgz4hNSSCA== Received: from DM6NAM10FT036.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::4c) by DM6NAM10HT054.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::320) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.18; Sat, 12 Jun 2021 15:20:05 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:7e86::48) by DM6NAM10FT036.mail.protection.outlook.com (2a01:111:e400:7e86::438) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.18 via Frontend Transport; Sat, 12 Jun 2021 15:20:05 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::20ed:6cd1:4fe2:eea7]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::20ed:6cd1:4fe2:eea7%3]) with mapi id 15.20.4219.024; Sat, 12 Jun 2021 15:20:05 +0000 To: "internals@lists.php.net" Thread-Topic: [PHP-DEV] Re: RFC: CachedIterable (rewindable, allows any key&repeating keys) Thread-Index: AQHXACLkMdQqZoaVtUy2vSZWXRDmOasLeFTVgAHzyACAAJB9eoAAEBuAgAAUvgCAAxLhGw== Date: Sat, 12 Jun 2021 15:20:05 +0000 Message-ID: References: <8b158f57-5416-1e86-07de-737e78338da7@processus.org>, In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:77A0C57BF30DB50DD7067C30ABBA89ABE4F879F8B2C63EFED5A84B3962280CE1;UpperCasedChecksum:CC4F4640466565A79B83B394A1923054D6E2422D1748D3F476BF1CF0B5DD3CA6;SizeAsReceived:7504;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [sG6746La/df8PVchbP14Lw2jblfywlQ782/KaerMlMSNOblF/70O9yjDH6yhOG0N] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: d018813b-3492-4279-8ecd-08d92db58ebd x-ms-traffictypediagnostic: DM6NAM10HT054: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iok/GTC0Of2guBmfXw4+LEMRklVILpKacx7y5oZ2zMJKjibyg85YcF6IO94c06gQNVVKo0BIe45856yGvJrzYdWMzLtr71R1plU/0sVIpb84wrlGT8IhW7Dff1izoLhnRtz1gVS0eoqvqIp0gR1bNIBFCNjo/9KNw7qHq9BYJHWvS0d+CzU1qkHfpZYfo3xa1r5SuJ0WyirLchGl5u1wJJ+Kwjtp7MEe49HrIb2cZwPR/E6WFliW4AnWLfTsrmYDfq0YLUHNfYCOL+sw5kazIxN1x7P0ONiILDFsde6Qzqqr1AQ/s9TWNytn+v4vPDmeUZIC/vyv/6SeVstGBw1wChXmv0aZ1oLO0fQwIAeDVntb8wZ+A+qNI5jGne26MWSLHBpXGjSykD1NkdfGKpybaEmK/8vHdgi1HsHgXOxwyBlCmfhu47bBHrrGPKxCAHSvG4EvpZjArsWeF5j0lHHM+A== x-ms-exchange-antispam-messagedata: xVVxH3KA30oZaE3uK3d1DYgrmulezjtS0p8twFJUmPt6KR3GeRwxJrnn25AXjyzT5mI+521knE2zhDe+EbcSS1BQMBZmKB3GzWkDYOkN9RbzkD3g8MEZE/TnJ/C1SGvRait8//ZT34azaxgg+UbCGdXEeVyI8HGg1TXzVQaU1zPF2zeTyqSbclqaXnaFbelq/iFeMc6aMQMcbI5xwxWjYw== 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: DM6NAM10FT036.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: d018813b-3492-4279-8ecd-08d92db58ebd X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jun 2021 15:20:05.5554 (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: DM6NAM10HT054 Subject: Re: [PHP-DEV] Re: RFC: CachedIterable (rewindable, allows any key&repeating keys) From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= > > > So I'm probably changing this to `ImmutableTraversable` as a short na= me for the functionality,=0A= > > > to make it clear arguments are eagerly evaluated when it is created.= =0A= > > > (ImmutableSequence may be expected to only contain values, and would = be confused with the ds PECL's https://www.php.net/manual/en/class.ds-seque= nce.php)=0A= > >=0A= > > Hello,=0A= > >=0A= > > And why not simply RewindableIterator ? Isn't it the prominent feature= =0A= > > of it ?=0A= > >=0A= > > Agreed it's immutable, but a lot of traversable could be as well.=0A= > =0A= > All iterators are "rewindable", though of course not in practice. I=0A= > would avoid such names because we may eventually add an interface=0A= > which works as a "tag" to say "yes, I actually do support rewinding."=0A= > =0A= > The property of being rewindable comes from it being cached. Maybe=0A= > `CachedAggregate`? Aggregates are data structures from which an=0A= > external iterator can be obtained, so it makes a bit more sense if=0A= > it's eager.=0A= =0A= I think CachedAggregate would have problems with an unclear meaning similar= to those that were raised previously in https://externals.io/message/11481= 9#114798=0A= (Some developers would think it may refer to the act of lazily evaluating t= he iterable(caching it on-demand to access later))=0A= =0A= https://en.wikipedia.org/wiki/Aggregate on its own refers to a collection o= f objects/values=0A= or in other contexts, functions such as count/sum/min/max https://en.wikipe= dia.org/wiki/Aggregate_function =0A= =0A= - In other contexts such as set theory, there might not be keys associated = with the values=0A= so aggregate on its own seems unclear.=0A= =0A= ImmutableIteratorAggregate or just ImmutableIterable/ImmutableTraversable m= akes more sense than `Cached*` to me.=0A= ImmutableKeyValueSequence is an even shorter name than ImmutableIteratorAgg= regate and describes what the data structure is.=0A= =0A= Thanks,=0A= Tysosn=0A=