Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109792 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81245 invoked from network); 23 Apr 2020 00:15:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Apr 2020 00:15:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 527491804C7 for ; Wed, 22 Apr 2020 15:47:31 -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.2 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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, 22 Apr 2020 15:47:30 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2F5A85C012B for ; Wed, 22 Apr 2020 18:47:30 -0400 (EDT) Received: from imap7 ([10.202.2.57]) by compute7.internal (MEProxy); Wed, 22 Apr 2020 18:47:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=VwyY33zWKlil7E1RuR67YwuME2qlX6//uF+XV4ju7 vo=; b=ymdLdayh5wQVrt4BQgl2gO3zuC3QcdZTuioOcBqZQ0Al2cnTcn8W9OPru z9zolOJE1nPQAkNQ6ikcSbWM5ajRq6J/GRPlzcARemwINk97krl1vFZtHSWozT1e OKfBEBWiWiCJdwIiKX+gymwidHGjIxFDbTKUEFIf34xbGrNPR7fna5hiVID4OO2H DO2iv8jLIwY04bAA64hwK4j0zX6LLhg7HiXxIU5vrYh3YnN04t8kEbxu7Zn/BZ/I guYvxqJNO5e81LCYKkJmUF2aQFq+Bda1Z65rQIzIFF+1Hq6Xa/0dtP4h5hDxCQGv AhGJNbnKTmvTXBAIRdicQRKtjC/LQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrgeekgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehl rghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id CFAF5180091; Wed, 22 Apr 2020 18:47:29 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-351-g9981f4f-fmstable-20200421v1 Mime-Version: 1.0 Message-ID: <73b33704-ded2-4cbc-93bd-17e8874177f2@www.fastmail.com> In-Reply-To: References: <4c1cd016-1e41-4ebc-afc4-d8d3cd1c319b@www.fastmail.com> <31441489-11c6-4d99-9c53-6ac0e877f268@www.fastmail.com> Date: Wed, 22 Apr 2020 17:47:08 -0500 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Any interest in a list type? From: larry@garfieldtech.com ("Larry Garfield") On Wed, Apr 22, 2020, at 3:44 PM, Matthew Brown wrote: > > map/filter/reduce need to be recast to work on any iterable, which w= ould > then include lists > > Lists would only make sense if we're also rethinking how collections= work > generally >=20 > I disagree =E2=80=93 I think the most successful PHP language addition= s have been > those that allow PHP developers to improve their code without having t= o > think too hard =E2=80=93 for example, property, return and param types= can be added > to existing code without changing its behaviour at runtime, as long as= the > added types align with actual behaviour. >=20 > If list types work in a wholly different fashion to arrays, they won't= be a > drop-in-replacement, they won't feel familiar to the average PHP devel= oper, > and I imagine few people would update existing code to use them, becau= se > it'd be too risky. 1) Please don't top-post. 2) I don't mean "make them as unlike arrays as possible". I mean "think= through the implications of having a *third* type of iterable; what oth= er functions would be affected? Should we reconsider how map/filter/red= uce work generally instead of just throwing a bunch more random function= s at it? What are the knock-on effects? Should we also be adding a ded= icated dictionary type as well? Why or why not?" This is the *design* process for a language, and it's important. "Let's= just throw a numeric-only list type into the pool and see what happens"= is a very bad idea. Stepping back to reconsider how collections work g= enerally, and how we can improve them in a graceful way that leads to a = clean end-state, would be very valuable. --Larry Garfield