Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119689 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50588 invoked from network); 13 Mar 2023 20:44:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Mar 2023 20:44:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 48AE91804F7 for ; Mon, 13 Mar 2023 13:44:32 -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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 13 Mar 2023 13:44:31 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 582995C020D for ; Mon, 13 Mar 2023 16:44:31 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Mon, 13 Mar 2023 16:44:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1678740271; x= 1678826671; bh=YIY1yocD4/+k53xfEHrwYKoGrh7tEY6uaUlV6RYS33w=; b=a jTO7re6QeQ4UKkMpWWy2Jbmh7gqLste0OxF8VZHuMMV+PkE9xoolU4PwRLQFypiU BV0PHPYaZAOiQEiLZragWiPmFaGehaOUhJ73LNv3/lph3hj9mwZmoElFHPp0s7xz U6S+7UKL9Vc51NDf19aL5F28sbq4TUKBEkKlcCHvuSgy1kXJtII/8gQmsAEH0ETg yhVxGoL0uaFBcKXXR8nihI+1GD+ZOErb7NUKVaZlEEzea3y7SQGmALlowDuKxaOk C6YT5hwIx/IUj8j+xkv+4rMZbE0gpf4nMkAKfZ0yAYQ3+AULGdGPPlSE2vrS5/ph EYNLblM1n+rIxMkG3A/FA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1678740271; x=1678826671; bh=YIY1yocD4/+k5 3xfEHrwYKoGrh7tEY6uaUlV6RYS33w=; b=Mv9aM6YOgw73yx/DbL02ZnEhwJH2z T5uWUZO5e3OFNSYQTxKMLBhjakjerqYqYJGa7tCb4CjVwTFhm53utF4BJdDN+Ouh UERA+sbAryJgLU8spG8RZ83x+kjBc2MYzp08K0v2q7IZpGAzD2t+zRIml4mb6dgK 7cL1bklE3Zr4P8bJhWrY9EwyU3JbupqxcYr6cpZhW3MbzsveFSvcfNwH+0XQt/0f e9M89uWJhvWy7LmFbU18cnwaN1uQeeAphINLxGAzu2zPmmyMNa2x+4ACJR0Yv4+9 FoA+FVO3tFV5J8iscFPM3kMCaTubE5WL4zEqd03O5znsVqFKM3j7fEUPA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddvgedgudefkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepgeelgfekudeivddvteffueejffdthfejieevhefg ffekudevkedtvdelvddvffefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 19D051700090; Mon, 13 Mar 2023 16:44:30 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-221-gec32977366-fm-20230306.001-gec329773 Mime-Version: 1.0 Message-ID: <9a2140b4-97bb-4a9c-90c5-809274c83f75@app.fastmail.com> In-Reply-To: <1A2CE63B-ECCA-403D-83AC-B1E26279323C@gmail.com> References: <9975B833-EE24-4ED7-B28E-841B92988BA0@cschneid.com> <1A2CE63B-ECCA-403D-83AC-B1E26279323C@gmail.com> Date: Mon, 13 Mar 2023 15:44:10 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] First-class callable partial application From: larry@garfieldtech.com ("Larry Garfield") On Mon, Mar 13, 2023, at 3:36 PM, Rowan Tommins wrote: > On 13 March 2023 18:44:48 GMT, Robert Landers wrote: >>My approach was more of an iterative one. >> >>1. Get left-right done so that >> >>$x = something($left, $right, ...); >> >>would be allowed, but not >> >>$x = something($left, ..., $right); >> >>This would bring some immediate benefits, as initially proposed. > > > There are three problems I see with that: > > 1) The choice of syntax for the first version immediately limits the > options for later additions, so you still need to discuss them. (IIRC, > the proposal that went to vote had separate ? and ... tokens, but a > number of different variations were experimented with.) > > 2) Most of the goals I mentioned above are not about the syntax, and > are no easier for left-to-right - for instance, copying the type > information for use in reflection and error messages. > > 3) Unlike purely or primarily functional languages, PHP's standard > library is not at all designed with parameter orders that lend > themselves to left-to-right application. I gave array_filter as an > example, because it's exactly the kind of function people will want to > use PFA for, but wouldn't be able to with left-to-right only. Personally, I consider this the easiest thing to "let go of." As has been discussed numerous times, all of the most used array functions need to be redesigned to work with iterables, and in many cases make more sense. That would be a natural time to also revisit parameter order to fit with whatever partial application syntax was in use. There are limitations to that (a left-to-right-only approach would then preclude optional arguments, which is not ideal), but "compatibility with the array functions written in 1996" is probably my least cared-about criteria. That said, full support as the original RFC had would be ideal. It's doing it in a clean and performant fashion that is the challenge. --Larry Garfield