Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114776 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76634 invoked from network); 8 Jun 2021 00:54:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jun 2021 00:54:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5A1521804CC for ; Mon, 7 Jun 2021 18:09:12 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (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 18:09:11 -0700 (PDT) Received: by mail-qv1-f52.google.com with SMTP id u14so7054530qvq.6 for ; Mon, 07 Jun 2021 18:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=wPWdHtRogtKZ5vbkG3K1jcMZ3vacqYGIYu775+DDr10=; b=z49cuvD6OijoKaktUVOaPnztPxl3nAfn6CaHOE1o9CjXTCXGoUXc3wbLJ1VHq++dhE jPuQl4WA3GGokuWCFbZITs+N8gMNuMv4p36T4XM8HZHLabWNzd5ikYinr3upFbhtplE4 K8l9siQgJ/vu7MvzSATP95zE3iq+UX8Y7POWDutvWU+fRiyCVYzGvMV3pIKeSEwBGbZh BfHYNcLFZ/qa7DaeJYvOMd/QZuhSeTM8w0PZfLo3NK5sX6byGVEsQIUGyWeOqBo411Jf RRTN8sZpYmneUH1HQr5NyjGhoBBnRl+7U2A6uOIv/BLwfUc6f0S3GB35QKRSVTOc5bqV meTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=wPWdHtRogtKZ5vbkG3K1jcMZ3vacqYGIYu775+DDr10=; b=go6YZqF3/s1GVl2ezLpTTh1Pu7VwAG7GRQjSsvb0mV0wNk+qoqkiiDr7vhCuV2fJRn onzzfTsC4DQRcZXl6cbKHWBMYM3W92ujyPhU26Wg4hwvZK6A5ftE3qMqoRICYTd/77XB RrDuvWyjFbMEpKVNY56/2pOXXu/m1ParLL8XnoF/foEg5wF3eBK82a3KfI3kvN7uFQKA CyMei7HyUcpfqwwOS7Jbs2vofPuP7hTaXBQ6x4xaO5vgiZw5eq226gaFjqSMTpTgXjxy 0SxxRxb5S9kokpFxZzazf79UXPZT91cyaGBFWta0TYuGn0ZR4GdH1FEwRmWi3MAqG1g1 ckgQ== X-Gm-Message-State: AOAM531gpAbpNA1MCZC5y5E/kibRfMz5p4sr/paGbH4c8K0Wfdyzed6D caUrXpIOGo48ABT4WeCdD5qpAw== X-Google-Smtp-Source: ABdhPJyMD42I90ARPzukP5Lclw6sZrN5WuNHZCyxC4yJewa3LyuutAZjv5uyv7AkoOQ6IRdttsZdFg== X-Received: by 2002:a05:6214:4d:: with SMTP id c13mr20617764qvr.15.1623114550667; Mon, 07 Jun 2021 18:09:10 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id r19sm1758256qtw.59.2021.06.07.18.09.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jun 2021 18:09:08 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.6\)) In-Reply-To: Date: Mon, 7 Jun 2021 21:09:04 -0400 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <68DF0F38-621F-407F-ABEE-FEF388122EC9@newclarity.net> References: To: Larry Garfield , Derick Rethans X-Mailer: Apple Mail (2.3608.120.23.2.6) Subject: Re: [PHP-DEV] [RFC] Pipe Operator, take 2 From: mike@newclarity.net (Mike Schinkel) > On Jun 7, 2021, at 3:00 PM, Larry Garfield = wrote: >=20 > Hi folks. Me again. >=20 > 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." >=20 > The PFA RFC is winding down now and is looking quite good, so it's = time to revisit pipes. >=20 > https://wiki.php.net/rfc/pipe-operator-v2 >=20 > 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. In general, much nicer with PFA than before. A few questions though, although #1 is probably best answered by Derick = Rethans: 1. Will PHP consider a piped sequence a single expression? More = specifically, will XDEBUG consider it a single expression, or could = XDEBUG be able to set a breakpoint at each pipe assuming they are on = separate lines? =20 I ask because if pipes were an indivisible expression from the = standpoint of XDEBUG and breakpoints I would not want to see them = included in PHP. Alternately if included in PHP I would avoid using them = like the plague just like I avoid using fluent interfaces because of = their inability to be breakpointed at each step in XDEBUG. 2. Besides `throw` will there be a way to short-circuit evaluation = mid-way through the pipes without having to write all of the callables = to respect said short-circuiting and just return?=20 For example, could returning an instance of an object that implements a = `ShortCircuitPipeInterface` allow the pipe to short-circuit, or some = other way to short-circuit and then determine after the pipe if it was = short-circuited? -Mike=