Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114897 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40849 invoked from network); 15 Jun 2021 22:54:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Jun 2021 22:54:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 235601804C0 for ; Tue, 15 Jun 2021 16:11:30 -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=-0.5 required=5.0 tests=BAYES_05,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 NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11olkn2101.outbound.protection.outlook.com [40.92.20.101]) (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, 15 Jun 2021 16:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I61pzyZPH+UXcuA3v/bXZhQdcP2NT9ecVVFU1hqdbTdPjwLfdIHvB5OkpWq68kMCMndSDKVdsb7d2cVaWpN2jF0FgnSl7dqyAPshOA+5cO294CGHq64op/E1J1CEZwWGkVh3l+90jLT1BQF9ZU7AnXBaztG+gZli+QqmYYdXztaOlCGyiNgiiK+q9H2PRVwwZT/KW/thM0BPWVtZaO1FEB2zsBMn6KHWyH2qRn7MeuHuQVsKVpioYou86tfC967/af8gGfJ9L0kXRo3ohOElc0FSvazpOCPrcNnwPBSNLk8z9KXdfmiR3U0uRMuJ3AwbMtHCC/e9errz08gnMfdhWg== 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=XqU18dnPsJ0lXfjAMiQW+uXZqyOvFsJOiI2npGiUQR4=; b=ItiUmzDd37L+MOnxIt1N7H006QVQRuqVV+/CcsjKNN6bwjuTBBwPZ2at1zGkSD5F/b7uEsYC3QdOjTnE0iQcjikGfk90RwtcTty2T6GLMMAd74t60OZVDUVO9GhXmUayg7PAjDMYVaba7zb2WyzURlRWjTN74VExrKMAOODfAbRuoSCA9Bx8krirPe5EOMPunNify+oeDvt3UPR1BWN/eOk7x/J6FLj0CAFFzDK1wDCttCExQpcP4ZOYa2Q7bUHVoZpgdo7Dn0vSxpnjK/jIRflsJLO4A0TsYksPxBoJ5pvnb/5umK+0aSvufqeTZtUga1q6PZggDejN83j1ggK6Ng== 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=XqU18dnPsJ0lXfjAMiQW+uXZqyOvFsJOiI2npGiUQR4=; b=Bs+OrGAiDuVEDKVtq+W4KHZK7i0sHqSCm8QAEZX++Q13bEw/908d+0Bp+WlfNUh+qlr5uEdtabVRfHp180Q4p/VpXCbYIj5XxzOfv+MyJxSoQv2BfOII6dZw5d3/JnEi93Zg8XWAx5qVShL/m8yjtXK/lNnIZONkP2qy/ytt3ttXAA7CgVVWah+0ISxzDrGxKQAO1tLj5uERvuQZT4DTOYPQ1id3iAtaYY4500RFSgGkSY3DgLw1efxRi9+UECqHDyuaFuGV2Q4G44nk1HFqpjr2/+xGWAXViLCRoH366xKXhdac3bd+Nl6U2n9UYXuhpY+c7i4cr5cgonSF8EK8Vg== Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::50) by BN8NAM11HT117.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::446) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Tue, 15 Jun 2021 23:11:28 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:fc4b::4c) by BN8NAM11FT065.mail.protection.outlook.com (2a01:111:e400:fc4b::319) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Tue, 15 Jun 2021 23:11:28 +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.4242.016; Tue, 15 Jun 2021 23:11:27 +0000 To: "internals@lists.php.net" Thread-Topic: [PHP-DEV] [VOTE] ImmutableIterable (immutable, rewindable, allows any key&repeating keys) Thread-Index: AQHXYe13gwPEOnQYu0+kS+xXdQPfpqsVHrmAgACSMBM= Date: Tue, 15 Jun 2021 23:11:27 +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:C402A34A269F8BA4AB8E866D0DCBB7777B568F4F393F00FE7D00EF2A05B58B93;UpperCasedChecksum:65DF9896E3D04C135659CD8A39F449DD911BBE4F21453A158E522C12E1C5910E;SizeAsReceived:7201;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [YPQbQ+gKF+ym6yobSKf8ITTsMfiAYq2CbmWCFy8Ihi+/oIlA8wTQzj3SMSRfBDrP] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: e3f99cf1-cf6d-4aff-127e-08d93052e787 x-ms-traffictypediagnostic: BN8NAM11HT117: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rglybrT7DoNdQ75VxRTcNXT6mypIAF7ZzGwOLx5fXKmegZIX6HMTnISHfe4V8banUnY8NQaUe5KAwZQL9G9SZEhMDF2Xeo6lZReqmhSn4+geLScrK/hx3BwYpPXVcjCUG7VHVTIaRg2WHhhJksVYYCQ544KgUSZ1vaorOvQ5iFsoT9DYH/bIGRh6IUb27fF5Ccmk8x2TnBMhxRZO7ppf6x3Ks2cfZL+6bcaCgJrctZsiqmXX+WDn7y2VtSuj2lU59jI7jwsi7j1tE7XcsENUhyXAopbNdF8D41+o2bewziuA0R0li2rlXQE8iIUF67KWFdim4nL0M13x2X8zRvuNpDkgzSELQsGT+F4FwH9Gg2+wViRplCTJmzaORHL0n8Klk8uKrQb94rIi4/NueeNmEFHa7g434oZ6dwjm1Q27JbmVvV7+mBVLFLlYEt3G6uTPwwKR44T7BjJhr7LUW//Izw== x-ms-exchange-antispam-messagedata: 4wutXWylVJWPxkmX5lkiS2xsvCpCIelQOfVlFBBbOY/aBTtq97IcdmyVb2ulm+7p/p+AsrqnGORVCIF6JYlBXGnPgaMspP0HI2tgCcEBGIS+J8erfBYyC1Uiv7iFec3HSxZ6Cn7w+ZttcEp1Sh+bkRBwK+ck32GFphiUXzqx42I2Bx5J/1SFELeYgw/zE/O1IZTCIeYVIuZ41A7CsyWqcg== 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: BN8NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e3f99cf1-cf6d-4aff-127e-08d93052e787 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jun 2021 23:11:27.8996 (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: BN8NAM11HT117 Subject: Re: [PHP-DEV] [VOTE] ImmutableIterable (immutable, rewindable, allows any key&repeating keys) From: tysonandre775@hotmail.com (tyson andre) Hi Marco Pivetta,=0A= =0A= > I see the RFC as valuable but:=0A= > =0A= >=A0* `__serialize` and `__unserialize` are out of scope: this depends on t= he contents of it, and there's no point in implementing them=0A= >=A0* `__set_state` should also not be implemented: `var_export()` like any= other object and it should be fine=0A= >=A0* `jsonSerialize` also depends on the contents, and shouldn't be expose= d=0A= > =0A= > All of this is not part of what should be in a reusable iterator.=0A= =0A= This is an IteratorAggregate implementation and all of the contents of the = inner iterable are eagerly evaluated in the constructor.=0A= I'd also considered names such as ImmutableIteratorAggregate, ImmutableKeyV= alueSequence or ImmutableEntrySet, but was unhappy with all of the names (e= xcessively long, misleading, ambiguous, etc),=0A= and prior discussion on the mailing list lead me to believe short names wer= e widely preferred over long names https://externals.io/message/114834#1148= 12=0A= =0A= If it was lazily evaluated such as proposed in https://wiki.php.net/rfc/cac= hediterable#future_scope , I'd agree that `__serialize`, `__unserialize`, `= json_encode`, etc likely didn't belong in a lazily evaluated data structure= ,=0A= but the goal was creating a reusable data structure=0A= (e.g. that could be used to store key-value sequences from any source compa= ctly (e.g. generators) and be serialized=0A= and persisted to memcached, redis, a file, static array, etc)=0A= =0A= Cheers,=0A= Tyson=