Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126324 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id A6FEA1A00C1 for ; Fri, 7 Feb 2025 08:17:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1738916063; bh=8GQWq5Q2OVaY9tZEWGUSU3wAIK/eKn5p44xh5lBUCO8=; h=Date:From:To:In-Reply-To:References:Subject:From; b=UxDJdtfbcoGtsFqVfwrLjFP5pJccdFreYKYc80Vnb1LdMcUtTE9Y7wAphL7ICgSNi wHUXZXAnX5oLu1F9qUpJfjPzblVsfB0JA7trpU/ht27iACArojnrBrKEpO3n9dL2tB jPeSC7HvqtDJ6zsOYLtG05u6ap/M/gVENUNXGIPQsoxWzQwxxBX46DygIik6XDhHDR POdtKXlJroI2/xj7KsCKf3mu1sOyiSEyVWY9rVqIv/5OJf7vbdB5Rtaz11cG1MZ+tm k/cNudG95sJ0TNk1IvyWWEPOr65aLo/UAHta00T7e9+ykH/GQibi/iJjPvBCHa6x8O 9vl+DaPg5AI6Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 34C6D180088 for ; Fri, 7 Feb 2025 08:14:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b8-smtp.messagingengine.com (fhigh-b8-smtp.messagingengine.com [202.12.124.159]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 7 Feb 2025 08:14:18 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 65DA42540121 for ; Fri, 7 Feb 2025 03:17:03 -0500 (EST) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-01.internal (MEProxy); Fri, 07 Feb 2025 03:17:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1738916223; x=1739002623; bh=Nhw9hEMKYzQff3KxZ15+s hoKddC/YgWN70myM+nqg78=; b=CnXGUbeM1ciOIO4181rzZJmKToepiLMgg5lO8 PnbUcqD90wDaLd4nVEoPdhUnLtYOmLWVJh+lvaO1R8T36jsxaV9lcfVkknuhHNhB CNWXL1wO8i/JM3qjDcudvkwesl4KD3j2C6NwvuiZKDH1u+ZphnMKs6wSCiYRcVnC rmGBAgbUowen5DMp+EQrzsCZNkeYkv0hrktNWiGrRGjshPHFLbufja4kP91M0mQd i0NOUTenvqBZoD3IMW8TM1a7ODQ9aNmn4Ksi+QjhVNA639UWQ6Va0EHuBd8Ptmr5 c3QecOKtdDpFOPZPPUL5ljctJJEe8RDOLHSmNSkhjxo9plmTQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1738916223; x=1739002623; bh=N hw9hEMKYzQff3KxZ15+shoKddC/YgWN70myM+nqg78=; b=xTHV1gZIL7n35/lKI 1ekBIS/InkScQpoBKkp7bb/avM5+a7DsZy+zzMlXhJJ4HxCrW0ZBajbnGrFFd6ec HDNfLOIHHpVafT533T+N59V826dXRhlgmslrckl5aBQdL9xFx/WGwdZok4yQIKMh yzbNw5pYquMQxUVoiJ4eYqnHQ4mE/1Esnxunno9xXNdmRh65wNZn1AHipbXyby7k waWPtdExzxhTHo1a450tsnNBGR5UYgFII1q6tSlnlQ9q896k+DdAGgQZLM0U3gIL +QbaTFgyj0bRWPIHBljKCSd69VSiCpy2IpsROCnJdSnnbAAPvc+EtfFTk0S11Jyl aJBkQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvkeejjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvkfgjfhfutgfgsehtjeertdertddt necuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfh hivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhepudegvdelgfeugeehfeej teffudevleethfefgeejffffleegtddtveekgeekudfgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgv tghhrdgtohhmpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtph htthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 0090F29C0072; Fri, 7 Feb 2025 03:17:02 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 07 Feb 2025 02:16:10 -0600 To: "php internals" Message-ID: In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Pipe Operator (again) Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Fri, Feb 7, 2025, at 1:36 AM, Eugene Sidelnyk wrote: > Hi, Larry, That's super! I hope it will pass! > > Oladoyinbo, IMO the way it is described right now (e.g. explicit > closures) is much more elegant than a new way of doing things that's > not so obvious and will be necessary to keep in mind and support > anyway. > > If it'd be necessary to simplify the stuff, like passing particular > parameter from the input pipe into the function at the particular > position, - I think it would be possible to do it with partial function > application I hope to see in the future. (e.g. bind callback for > array_map function, making a new function for the pipe that will accept > the only parameter - input array) > > Thank you Both of you, please don't top post. :-) That said, Eugene is correct. Hack (Facebook's PHP fork) had a pipe operator that took an expression with a magic placeholder on the right, rather than a callable. Every other language splits it into two parts, a pipe that takes a function on the right and some way to do easy partial application. I am firmly of the belief that Hack is wrong on this one and two separate features that dovetail together is the superior design over making a single pipe syntax that is less flexible. Especially with FCC now, any purpose-built unary function will be trivial to use, and a higher-order function that returns a unary function is also trivial to write. As noted in Future Scope, I do want to revisit the PFA RFC at some point, but I need a collaborator who can help with the implementation as that is definitely over my head. (I have ideas for how to simplify the implementation, in concept, but my engine skill is too low to do it myself.) --Larry Garfield