Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114906 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19701 invoked from network); 16 Jun 2021 13:41:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Jun 2021 13:41:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C34591804DB for ; Wed, 16 Jun 2021 06:57:48 -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 NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08olkn2044.outbound.protection.outlook.com [40.92.47.44]) (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 ; Wed, 16 Jun 2021 06:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V8mBJMvDoD5f0D6zjHut04Oos+U1uY0/Qz0fsSpmMfWZIenXztyEUkw0toBON/E50qB03YX7wQuChd+p5Em5oszUY/cNZM/E7SKYWU7V5xcxo9G5sfwXv+zb6OxTlbi+JqGF22jzUfUpdQKKMctS0CVHzeVvql2bTOqUF7hxOMIxqDvEMNxVEusNPNxEmvLocn2RrXivejjCfgTRFyluAD1I86bLN9W8vw+XFKEwz1JZ+FdEUKa1DNz/szdGZkDdkJMsTnBseP7HK+CDlB/mywCrG6YfP6HUCQw3sK/9XXk0HCQGctNQddDKcC5gVmoDxCOXDMvgBUafdUea033uBg== 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=XNg8kHVjcahHJMC+ypK3zTAAkzzI2Mirt/HgFBOkDPc=; b=hvnWYTTJsB22Ld8K1RjJ1gKOiLaBhij1GAzmtOfwa+HGrLRT3tE2GMmXHelTUUZQWHctaISHMOAoVPobSkjUomuEP0rtX2VFPRSwPI2u5WAanfgtEt3UC5bEvwmcT9wbByhxaGMTHgKBQ07vIhGqHrFVKNNbLMuc4q4aUEFxziVNXohTQZt4skBxW2UF3i7SNQ54Vd5tpLIA/GImWTI8sXmgyc2cAE6etMdCMJRPvPxM1l7OVcFZglqjsSuTpkg3Rg0N/9GnjvJzV5KlZGFlPDtALM9WjusTzs7PNMtwuCKG+EBHgBo9751PlWN1uoQYEzUFBRl225hXTZ4RygbtCg== 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=XNg8kHVjcahHJMC+ypK3zTAAkzzI2Mirt/HgFBOkDPc=; b=l/LELtCJKcvGUOVSdjpzkFOmT9TEGag+IJBVxKrCkXDYgQSKtWwz8HMhdlQ+OYsnleKGqH3wLO7bgzwIaBBpSvngOFHi+8du0rywTJqO+jw5lNnuAIAGSMH4Fs0f8nt83vjU9e66kR73b0uz4njjF59arj63x4UMeo5N/eUR7b6VP+Y1Vdl94gV097d735IEc3qU+Ib/kVsPW83A9d+F4HpX+60oCN7Tbqrnoj/Upw8eX8CcWsX4ftj9SEiC/KDcdQQkoMTsb8mCEYdJY2gclNpJkfUF3hLq+1Crup50LVFlpz8OH9VgSusZMFgwmrdNfrVWBtvjxtXc/ZDXsezxug== Received: from BN8NAM04FT027.eop-NAM04.prod.protection.outlook.com (2a01:111:e400:7e85::41) by BN8NAM04HT083.eop-NAM04.prod.protection.outlook.com (2a01:111:e400:7e85::93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Wed, 16 Jun 2021 13:57:47 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:7e85::4c) by BN8NAM04FT027.mail.protection.outlook.com (2a01:111:e400:7e85::396) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Wed, 16 Jun 2021 13:57:47 +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.019; Wed, 16 Jun 2021 13:57:47 +0000 To: "internals@lists.php.net" Thread-Topic: [PHP-DEV] [VOTE] ImmutableIterable (immutable, rewindable, allows any key&repeating keys) Thread-Index: AQHXYe13gwPEOnQYu0+kS+xXdQPfpqsWWbeAgABMCZQ= Date: Wed, 16 Jun 2021 13:57:47 +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:48E882E3CD91E75BE0C82EC4AB49B75A6CFD42BAE6CCDA98DF672A17A3310223;UpperCasedChecksum:85832D2706DC06972BDC3683509F4D5763ADAA435C4C3006A305F8311EDB4743;SizeAsReceived:7210;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [1Nt5/VNOaqTMiA5dh1hsvs0Q2GpEiKMxS8I80tJsxJBnpo95pfmMZWK67uDF49Am] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 447a4d48-cade-4753-4cc3-08d930ceb8ce x-ms-traffictypediagnostic: BN8NAM04HT083: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RiDpku1Rz287jvbuXm5uue8uzoLN76IhyEgCH9bwK0uXBMdslfOdtZNzwyCIFcKbA+Rb/vcZ2Wc8Ffwl+tzkVuWKC3uaezLWRjilp3IAgw/wsb6kLFU+DHrmEtJIgqtysOu8iWXMwFFTUCBL+jtgm+Lh9miqKpEMgtuT25tmcch6YuZP6Cuba+ZCki0b+mDVfutqTEPsIHbdbdwf7BOGcGA3fouMs1DBT/bSBi/VkV4JKQj6nsTQS6rwGIJ2NNyZWvs0Qgfql8RZe7vZtiHHrY1vDzlfgDX05JOVZyE94OYSRR92JqRZQV5Kq4OrNfd5qAnYzC/AwwiUeLtyszoHL8frMy1h1j2mCCv4QY8MCMUO3FRlGzDKa9WbgM8WKJOLV8jndZVLMZBSd2Z2sCUXFsrCXkt2uzpwS05YXntSLekg+QeJVOg75o74vXCBP/ovW23vTRxcozoChCgkE7mBUoSP8jRu+8h4v6fn4/KBKp8= x-ms-exchange-antispam-messagedata: QWLPAOPvFU/WqX20U6eP6qs5epVvjW8Y+HHXiY6yGKLjLFoKO0BOOkIVSgYd2DeDONIwXcQqDwGAOLFn//zlCeiSOsXFRq8qIfiM7qyxiOs26ijRmSoedTPCYKZdiUZfnwE5850rARJpWfuCnbMJUR/gSDmbK8WpnPxm4KlPR1pEz50+NSA1orNwKmDY0IQCcCsQ6XBgt9qzGZY5+akHAA== 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: BN8NAM04FT027.eop-NAM04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 447a4d48-cade-4753-4cc3-08d930ceb8ce X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jun 2021 13:57:47.0330 (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: BN8NAM04HT083 Subject: Re: [PHP-DEV] [VOTE] ImmutableIterable (immutable, rewindable, allows any key&repeating keys) From: tysonandre775@hotmail.com (tyson andre) Hi Nikita,=0A= =0A= > I like the concept here. I think the naming choice is unfortunate, and ca= using confusion for people.=0A= > =0A= > What you're really proposing here is a data structure: A sequence of key-= value-pairs. That generally seems like a sensible thing to have, in that we= can implement it significantly more efficiently in core than you could do = it in userland, especially when it comes to memory usage.=0A= > =0A= > The issue is that you're not really framing this as a data structure, but= as an iterable. I get that memoizing an iterable was the original motivati= on here, but I think it causes confusion. If this were KeyValueSequence::fr= omIterable($iterable), I think that the meaning and behavior would be perfe= ctly clear -- of course it would eagerly collect the iterable, there is no = other way it could reasonably work! I think Marco's concerns wouldn't come = up either -- it's perfectly reasonable for a data structure to implement su= pport for serialization and JSON encoding. Not so much for an iterator.=0A= =0A= It may be more positive, =0A= but I don't think it'd pass with any name or by changing the constructor to= fromIterable.=0A= Over half of the objections are to functionality, over half to unspecified = reasons,=0A= and other email discussion responses don't seem to indicate interest in hav= ing the functionality, just on clarifying implementation or naming details= =0A= =0A= I was trying to avoid proposing functionality similar to that already in ph= p-ds or an improvement to spl=0A= (especially with ongoing namespacing policy discussion),=0A= but that seems to be a mistake - if it was chosen for inclusion in those mo= dules then it'd be a very common use case=0A= (e.g. https://www.php.net/manual/en/splqueue.construct, https://www.php.net= /manual/en/class.ds-map.php, etc)=0A= =0A= Cheers,=0A= Tyson=0A=