Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109898 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61161 invoked from network); 29 Apr 2020 02:02:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Apr 2020 02:02:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2857E1804C2 for ; Tue, 28 Apr 2020 17:35:19 -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,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.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 ; Tue, 28 Apr 2020 17:35:18 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 5A60094F for ; Tue, 28 Apr 2020 20:35:18 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Tue, 28 Apr 2020 20:35:18 -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=F56t7M kNv20Ip+U7NUWWLJSca/vh470kQaOg47Jj4+g=; b=Hm5Q6YEIa4jcq0D8Lsa+2F HYwdTvz/ct3EpS047Pmw0pjsNWhoeB7pJmgyFxRukiEde5LerRzLUZdfH1H6XnOn mg4cc8oFhBcIXQ47+q03nA8lqsAmnHH8ofA/4ZTJNZAmVkF4w52XQh0hrYaQNANM YD2hbcZEo+c/TFR9RrWHL9DJSkB4k0OFSdjo1td1PtSvE7GqHNP1doN5X+2gjccG VkgfNc4v11c7H0v6ekzJ5R5/T48rUW6zC4l8FWjL9ncFNYE2PLc1aCmmc5krJ9dA BDTdCmNVNTrpz72WjgySSDesZa+jGZBfl4M+w0ycDSQGsbnoOQqXQLXZsraKiplQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedriedvgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgr rhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8FE4814200A2; Tue, 28 Apr 2020 20:35:17 -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: <46adaf3a-be5b-4eaf-b2fd-7243d00200e1@www.fastmail.com> In-Reply-To: References: <2677cdc6-309c-4e4e-9cd9-12ff2a90c1e1@www.fastmail.com> <93A509E9-E6BC-425C-A584-F49F094E75B0@benramsey.com> Date: Tue, 28 Apr 2020 19:34:57 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Function pipe operator From: larry@garfieldtech.com ("Larry Garfield") On Tue, Apr 21, 2020, at 9:43 AM, Larry Garfield wrote: > On Mon, Apr 20, 2020, at 11:06 PM, Sara Golemon wrote: > > Happy with the revival, and I do want to underline the "Future Work" > > section about Partial Functions. PF will make this version of pipes 100% > > more readable and fluent, and I want to endorse both, but I'll take one at > > a time. > > I agree that the pipe operator relies on having a "good" (subjective) > way to reference callables, which is a weakness of PHP right now. We > discussed that in depth a few months ago as well. > > IMO, short-lambdas in 7.4 are "good enough" to make the pipe operator > useful. They're not ideal, but they're sufficient. > > Levi's partial application RFC would be close enough to ideal; You > could reference an already-single-parameter or multi-parameter function > lexically without any string parsing silliness, which means namespace > resolution works, and it could potentially be optimized to avoid an > extra layer of function call. It would be even better than ::function, > IMO, because you can provide it with closed-over variables at the same > time. It sounds like we all want that. > > I do not believe that should block the pipe operator, however. This is > a case where two independent RFCs should be able to stand on their own > but create a "sum is greater than their parts" situation, which is a > good thing. > > If anyone has bandwidth, I'm happy to collaborate on the PF RFC as > well. It's out of my solo skillset right now (frankly so was pipe > until this weekend), but if someone is able to provide > hand-holding/pairing I'm willing to work on that, too, either now in > parallel or after pipe lands. Both should happen, but I don't think > either should block the other. Just an update: I've tweaked the patch based on feedback from a few folks. The precedence now seems to be where it is most logical (to me), and I've changed what the flag is on the AST node based on a recommendation from Nikita (assuming I understood him correctly). I think it's in an acceptable final state at the moment baring any further feedback on GitHub. It sounds like the only negative pushback at the moment is "can we do partial application first?" Which... I'd love to but we need help on that. :-) (Volunteers welcome.) Is there any other pushback? How do people feel about putting this to a vote sometime next week? I don't know how long I want to sit on it waiting to see if we can pull off partial application. I also want the partial application RFC, for reasons stated, but still feel that both are beneficial enough to stand on their own and it doesn't really matter which happens first. --Larry Garfield