Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114463 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87706 invoked from network); 13 May 2021 16:52:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 May 2021 16:52:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BDAEE1804B5 for ; Thu, 13 May 2021 10:00:26 -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.6 required=5.0 tests=BAYES_00,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-Virus: No X-Envelope-From: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 May 2021 10:00:26 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B55A45C01DB for ; Thu, 13 May 2021 13:00:25 -0400 (EDT) Received: from imap8 ([10.202.2.58]) by compute4.internal (MEProxy); Thu, 13 May 2021 13:00:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=IQ+MKJ zJfzY3DVpARTEIgMZhq/hVnBISVSJMHG9VVUE=; b=mAcqIZaTksvPmQdHEcDbgS LssSg1FyGpR0hUOmRWW2fpzsjp9WkTEWQxXu6oq/Fsi8gzyWvyxWFLuXLcPVTvFx TJ5dK6AXtu1NJuG8bCOCBTDHMvwjDuFnmXYHCM3xYqj7jZ+WS6JYoFcBvnC8Sqvt O2vWKHJp1fRDt9tv0X9YnzKmZPdo9MBAygkzHCsm5D8WJainr2Spvmb/Kb5pDfZw Wm0J/fVcBaM7OIkVcxJgh254Ym8HwxO/P6K/d2fzu8iKIB2ndfWk6IeTO8qF9F2V 7bt1g3XAniNMzMjIzDqESg8/jP81Bt2TtojJdKeFir8vnXss/g9vAuYoil7c9xWA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehgedguddtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepfeetveffteetueeukeegjeffudeuhedthfevfeeh iefhheegheffhedthefgleejnecuffhomhgrihhnpehphhhprdhnvghtpdhgihhthhhusg drtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 65CAA3A07EF; Thu, 13 May 2021 13:00:25 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Mime-Version: 1.0 Message-ID: <4340a481-e4a3-4805-8dfc-df3c037d6cdf@www.fastmail.com> In-Reply-To: References: Date: Thu, 13 May 2021 12:00:05 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Partial function application From: larry@garfieldtech.com ("Larry Garfield") On Tue, May 11, 2021, at 10:38 AM, Larry Garfield wrote: > On Sun, Apr 25, 2021, at 2:25 PM, Larry Garfield wrote: > > Greetings, Internalians! > > > > I would like to offer for your consideration another RFC, specifically > > syntax for partial function application. > > > > https://wiki.php.net/rfc/partial_function_application > > > > It includes an implementation by Joe Watkins that is already about 95% > > complete. (There's some edge cases he's still sorting out, but all of > > the typical cases should work already.) Most of the design work comes > > from Levi Morrison and Paul Crovella. I helped out with the tests, a > > few edge bits, and general instigator/nudge. :-) > > > > Discuss. > > It looks like the conversation has died down, and it's been two weeks, > so pending any other notable feedback I'll open a vote on this RFC on > Thursday or Friday. Naturally there was more conversation. :-) But good conversation, so the RFC has been updated again. I recommend everyone look it over another time. Highlights: * Joe was able to figure out how to fold the extra partial logic into the Closure object. So the Partial and ReflectionPartial classes are gone; partial application gives you a closure object that looks like any other, but still manages to optimize away repeated partial application. * Some descriptions were improved. * Constructors already worked, with some caveats. Joe managed to remove those caveats, so they now work as you would expect them to. (See the RFC section for details.) * I included some references to other languages and how they handle partial application. Short version: This is the most robust and most fully featured version of any language I could find. Rock on, PHP! :-) * Nicolas, I went ahead and made a test for partial-application-DI-autowiring, just to see what it would look like. It looks like this: https://github.com/php/php-src/pull/6898/files#diff-218bb085c4cf4a35da35aa2d7a5cabd77f053d6f975340c2ef10de6f30dee503 Whether that's actually useful or not I don't know, but there it is. :-) Since there were some substantive changes, we're pushing the vote start off until the first half of next week, Monday/Tuesday timeframe. Thanks for your feedback, everyone! --Larry Garfield