Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114778 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83613 invoked from network); 8 Jun 2021 02:29:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jun 2021 02:29:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 194A01804AE for ; Mon, 7 Jun 2021 19:44:07 -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,HTML_MESSAGE,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-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 19:44:06 -0700 (PDT) Received: by mail-qt1-f171.google.com with SMTP id m13so14206235qtk.13 for ; Mon, 07 Jun 2021 19:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=mCxDYu+94u+MBRIx67Rq1k4Lg359Fr9Fsb48GJTk3IQ=; b=oHGzykNV0+HihZlPt9rFsVkCXF/3NbhIltC+i7vjL7Kx+O7jetxfX2PgGWDKvnSdw3 2lb4Ij4DBgzfy7McFrp/Dslb4ebM28NMqJqttyRUWa8Rmp6Cu0hA4pr9807ggRXjSMJC yhpzAXurvvfWimSo5oh151/rRHQaRESzr0vhiNgvvgrQHvzJUoH7vPc8tVR4rQo971T7 rkIbAvma6hzD29YbzKY7lGN9ftFlMVcPBv3zdUe0ugJVG5fENuPHLFeV+RZoJye3DPoX qzvWHLaGZw/MN16UcmTwr60jlXKVZcRjGZe/6Cy0N/uBP4WdWNoeoK7SL24JWJxOm+fN VPTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=mCxDYu+94u+MBRIx67Rq1k4Lg359Fr9Fsb48GJTk3IQ=; b=KhNBUUKfRoVZNHYOhiDPNzzUTSk2B9p7lkRyxf0yDm1NflWfnZp71tAzEIKGnqkOVl frH3ilVHZkgbHjNkxZDz+jJ0Yo7lcouhymVUqvsU0Iwx5409uOAr/TNOZoSKlqEHo4fk wvJCgJwVKNGrWeeBNiF5SgOfczS4Ge3bN8bcpAq4pBBJVkF3awL7Ki09tuN9T4QcTqj3 fahRu8R+CorzVBjJO8oGEIr3uztPoUtQWMY9Gisn3lviMS56SbgXrh4fp3rpPw8657C+ KPZeCs6eHJKXK0pIGE3Kj027JcEHisO8aAC1yKO5k5vqHKg3hpFGg2wKpmx7sf7qYciX Mgaw== X-Gm-Message-State: AOAM531jeP/T18w8dv+MS0Q7Ikb6L7sCEMTb8YRljFt61vFamQtS5/Le ciJO7KlPzkmOM3pW/YYj8lLkhw== X-Google-Smtp-Source: ABdhPJypzc8rkKN883B37sBUN8jKecAFrdhA/hRjOb8Ocz4VnEXnG/S1f7Fijmt/g4Zzl6OMD/tAHQ== X-Received: by 2002:a05:622a:87:: with SMTP id o7mr19213121qtw.137.1623120244696; Mon, 07 Jun 2021 19:44:04 -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 q185sm10965563qkd.69.2021.06.07.19.44.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jun 2021 19:44:03 -0700 (PDT) Message-ID: <7D9B0065-8BCF-4661-B017-072568FE51EA@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_A541BE01-0406-4218-B172-E8F33EE5D778" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.6\)) Date: Mon, 7 Jun 2021 22:44:00 -0400 In-Reply-To: <9c271680-da84-4de1-9f28-c6507f4f557f@www.fastmail.com> Cc: php internals To: Larry Garfield References: <68DF0F38-621F-407F-ABEE-FEF388122EC9@newclarity.net> <9c271680-da84-4de1-9f28-c6507f4f557f@www.fastmail.com> 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) --Apple-Mail=_A541BE01-0406-4218-B172-E8F33EE5D778 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jun 7, 2021, at 9:39 PM, Larry Garfield = wrote: >=20 > On Mon, Jun 7, 2021, at 8:09 PM, Mike Schinkel wrote: >>=20 >>> 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. >>=20 >> In general, much nicer with PFA than before. >>=20 >> A few questions though, although #1 is probably best answered by = Derick Rethans: >>=20 >> 1. Will PHP consider a piped sequence a single expression? More=20 >> specifically, will XDEBUG consider it a single expression, or could=20= >> XDEBUG be able to set a breakpoint at each pipe assuming they are on=20= >> separate lines? =20 >>=20 >> I ask because if pipes were an indivisible expression from the=20 >> standpoint of XDEBUG and breakpoints I would not want to see them=20 >> included in PHP. Alternately if included in PHP I would avoid using=20= >> them like the plague just like I avoid using fluent interfaces = because=20 >> of their inability to be breakpointed at each step in XDEBUG. >=20 > $foo |> bar(?) |> baz(?); >=20 > will produce the same AST as >=20 > baz(bar($foo)); >=20 > So whatever Xdebug can do with that AST, it should still be able to = do. That is unfortunate. =20 Few people write code or would write code like bazoom(baz(bar(foo($x)))) = because the trailing parenthesis make it far from ergonomic. What you = are proposing therefore is an ergonomic way to convert a program into a = single large expression (when taken to the limit.) Given that your pipe RFC makes practical a style of coding that was = previously not practical it begs the question of addressing intermediate = steps in the AST to support breakpoints, which also might require XDEBUG = to introspect the values on the calling stack. =20 Unfortunately I do not know enough about how the internal = representations work to argue that this be considered a must; hopefully = Derick Rethans will comment on this. -Mike= --Apple-Mail=_A541BE01-0406-4218-B172-E8F33EE5D778--