Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114775 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 64260 invoked from network); 7 Jun 2021 21:55:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Jun 2021 21:55:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F1C481804AE for ; Mon, 7 Jun 2021 15:09:52 -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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE,URIBL_SBL,URIBL_SBL_A autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 ; Mon, 7 Jun 2021 15:09:52 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 16C615C00C8 for ; Mon, 7 Jun 2021 18:09:51 -0400 (EDT) Received: from imap43 ([10.202.2.93]) by compute1.internal (MEProxy); Mon, 07 Jun 2021 18:09:51 -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=fm3; bh=NVjJOK AGmpGv3/Ph1RfAjbA54rmINPcRZSsjpYOpALU=; b=B24k/3VbodsJseRTWWcgdV H2A/KzAIvxsoQV973+oVSECoKfh220oriRw24B70cTQnL/3kBKCWPzV0jbtiUqhN h2+5tUJ2VAaE/DyoLwUKQBm5Vn5nJLyrkOp4rJcXxGRRPQ/w/I1fTA1K6VmH+ibR 2xuwyAumPLzLoQXxCExZA9ySXzn7zQdCvs2tKC3CdLfA9iThup+j5HuVcnsPFumr LvI1uFxlhCyYaYsE+e1N+GYgk2AfwgfnPNDHmsAMoYhm0kKdHhx8SGCRo6b70FGM iBGYgwg79pEwbNP3dJlb0W11gb5szgIwN0a0JuqHAFlmjwac1o1YaTlxJ1ZYesRw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtjedgudejtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefofgggkfgjfhffhffv ufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoe hlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhep hffhheetheejvedtvdehfeetvdfffeejtdffgeelkeffleegvddvveelgeekgeefnecuff homhgrihhnpehphhhprdhnvghtpdefvheglhdrohhrghenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvg gthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 94FF0AC0062; Mon, 7 Jun 2021 18:09:50 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-519-g27a961944e-fm-20210531.001-g27a96194 Mime-Version: 1.0 Message-ID: <13daea98-c32e-491b-a37c-3e151dd1f6c2@www.fastmail.com> In-Reply-To: References: Date: Mon, 07 Jun 2021 17:09:30 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Pipe Operator, take 2 From: larry@garfieldtech.com ("Larry Garfield") On Mon, Jun 7, 2021, at 4:00 PM, Eugene Leonovich wrote: > On Mon, Jun 7, 2021 at 9:03 PM Larry Garfield > wrote: > > > Hi folks. Me again. > > > > A year ago, I posted an RFC for a pipe operator, |>, aka function > > concatenation. At the time, the main thrust of the feedback was "cool, > > like, but we need partial function application first so that the syntax for > > callables isn't so crappy." > > > > The PFA RFC is winding down now and is looking quite good, so it's time to > > revisit pipes. > > > > https://wiki.php.net/rfc/pipe-operator-v2 > > > > Nothing radical has changed in the proposal since last year. I have > > updated it against the latest master. I also updated the RFC to use more > > examples that assume PFA, as the result is legit much nicer. i also tested > > it locally with a combined partials-and-pipes branch to make sure they play > > nicely together, and they do. (Yay!) Assuming PFA passes I will include > > those tests in the pipes branch before this one goes to a vote. > > > > > FTR, there are several typos in the "Hello World" examples (*strto*t*upper, > htmlent*i*ties*). Also, these examples will not work as written because > explode() expects two arguments and will fail if you pass only one: > https://3v4l.org/tLO0s. I wonder what the correct version of the pipe > example (the one that uses strings as callbacks) would look like, given > that you have to pass two arguments for explode()? Hm. You're right. It used to, but it's been a very long time since explode() allowed an empty split, apparently. I updated the example to use str_split, which is what I'd intended to do in this case. Thanks. If you wanted to explode with a separator in a non-PFA pipes world, you'd need to wrap it in an arrow function. (Hence why a PFA-world pipe is all around better.) --Larry Garfield