Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115286 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 52019 invoked from network); 4 Jul 2021 06:57:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jul 2021 06:57:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 79D211804C8 for ; Sun, 4 Jul 2021 00:18:38 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 ; Sun, 4 Jul 2021 00:18:37 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id k8so19995419lja.4 for ; Sun, 04 Jul 2021 00:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Y8fceLEpqILCrRsMef6jvu7BW60GTGQMCpW16KMAoig=; b=fK/2GFj0ieA75bSArgOE+jC4PKTrJAJHONPuiQ/QLV2cSs0pdnpfXOK8JGHa4jaROl 3yk4KXIvHvfoDdi1bevLwucuZJCposR6qo7b2Bh2rflDLNsfy3rvRNdhjCwvAgBd+vHv TacwKAhIxqeQSv6ZQPCBMVM1TH4Ix9J+n1HNVLRlYKlgECjwBZJdfJT/G+7Q4NdhH1sH 3NvvemOAzQiO1a3BIE2SEgYZfdKIR73/7RVVykHsMPbVgWOoQbYC/TDtTo+U3JN56qm5 LZAvigVGZdcxL7a1MyJktkBCIIBXmGadLrliFdXOE4pqoxrOG9J8/nDQN3CidawFmTGU lj9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Y8fceLEpqILCrRsMef6jvu7BW60GTGQMCpW16KMAoig=; b=i4wNS5La9Nkg1B/2Qp8/Tjqxlx5QldXHiwYRAZl0iQAayjEDoAq6BASCs1ItkhdgDe dXSI7llh5FayBs1q0ItZwqRnXNdUZBckzm2/6Bl/UACe/ohCNpeZ3mI/UDjEXsfNhlg0 DIynUmYALmf79RpKlE1sVKQHG0mRoCmjYZ3dbVpIUuugWl/iayTZE8U3jsD7mCzHQWMS 1M5+APNkDLMyosAwv9GwB2tWsifA3ZL+Wkk1USe6OwfcotRtwzdLK4dBWlxCR9pxV8hf nw0q5ZHq8JkIxLaS/bagAt8u1rjZxzbVvMxSo/PXQe7VRZxmVU4LlgZI3I/Ks3AYcIQp e2sQ== X-Gm-Message-State: AOAM530odV3kGVsYQ/Vnn6WW1L2qnrmT2NFUKHESu4M3DHgQ65LScPtp 9QNMkUXOkVSE3PgQznPV7Y9zqOOUGjnmrv9RvqKjttSv X-Google-Smtp-Source: ABdhPJylYp1L8/a3bPMvciuVQI1yDUtrDNkMJU3+OBTRblWPLtRmE9MYUUqjwLciYOtR5DmGilyeGpBRhdt3/nJIQ7c= X-Received: by 2002:a2e:a595:: with SMTP id m21mr6615419ljp.470.1625383113809; Sun, 04 Jul 2021 00:18:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:7506:0:0:0:0:0 with HTTP; Sun, 4 Jul 2021 00:18:32 -0700 (PDT) In-Reply-To: <63aa426c-30bc-4f00-8740-532fa0bef6f2@www.fastmail.com> References: <63aa426c-30bc-4f00-8740-532fa0bef6f2@www.fastmail.com> Date: Sun, 4 Jul 2021 09:18:32 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Pipe Operator, take 2 From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) 2021-07-04 4:12 GMT+02:00, Larry Garfield : > On Mon, Jun 7, 2021, at 2:00 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. > > Hi again. > > With PFA being declined, I've again reworked the Pipes RFC. > > 1) It now does not use PFA in any examples, but it does use Nikita's > first-class-callables RFC that looks like it's going to pass easily. > > 2) With major hand-holding from Levi Morrison and Joe Watkins, the > implementation has shifted a bit. It now evaluates left-to-right, always, > whereas the previous version evaluated right-to-left. That is, instead of > $a |> $b |> $c desugaring into $c($b($a)), it now becomes effectively $tmp = > $a; $tmp = $b($tmp); $tmp = $c($tmp); That matters if $b or $c are function > calls that return a callable, as they are then only called when the pipeline > gets to that part of the expression. Hi! Can you flesh out an example for this, please? Not sure I get the use-case where it matters. Couldn't find any example inside the PR either (the tests) that show-cased this particular implementation detail. Did I miss it? Olle