Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93383 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29633 invoked from network); 17 May 2016 17:46:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 May 2016 17:46:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.223.194 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.223.194 mail-io0-f194.google.com Received: from [209.85.223.194] ([209.85.223.194:33389] helo=mail-io0-f194.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/23-11000-2095B375 for ; Tue, 17 May 2016 13:46:42 -0400 Received: by mail-io0-f194.google.com with SMTP id x35so4977931ioi.0 for ; Tue, 17 May 2016 10:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=NvXzZmeh/WzjYgzwaaJMhO6gofiYPlX4HT1uJCDg6MU=; b=oqew3Rvm+4okzSSKTALF2LXwixHM+igMSVml8yLXN6uYZrQ0WtWmZJI2MktFKKpzjJ fOmR5rfAGKw9y3IcpEnBVB5T7a9wZFDrZi3USQvcl/c6Btd4F4RAWMotkXX++26PQD0w UJ+uUk9lIomn62eq0j741/d4TzMayZnrKbWibbre3Lu0jsJDpzb0VURlc+LBQH+Bs8Yn gpCaHKRaAUuOjUbehW0OXwQOOU+aKiXJ979p4Qe8Rg6PHrSNT71IKbLuLyiVyco+uXeY Ah68Ig7gtHuVt8E++UrhbuGV6MAMfoY6pa3dF8WW6YKfiTnMSy3ys8xNxpuk6qjH+e03 hZ8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=NvXzZmeh/WzjYgzwaaJMhO6gofiYPlX4HT1uJCDg6MU=; b=I5qnj8EHxEj3BNREKE2Yd9k49+KKszZMgXIkG04Uc1gf5U+LV6pm812tZ1dFNxx/+Y BtVD3Df0BEAEUl7+cogxPDXDRBWGSn5Rml5TxLopufcvp84A/XJ52F/HayK62TpDCRIe Xtnft2zcdm9vbjENaNh9/RBvSF46yqeT/FPxsH/a+uqrhhWbgDhr32fAmuZCnMRyqul0 Y9sZWVX6rCuWltB5tDLRJ/x15hY8zDZNgAu++DuZ3OaH0n0rCviQPon3m3iuFSLn1Dhu U8gbmC4E+0FB41ynUYjH+lbvess9UI2UZ41DB9D7hRWaZoV+mN1OHiBiqyPKXWuNozB9 u8Eg== X-Gm-Message-State: AOPr4FVEsf6j7GrslpKbmEr2jrwBS0DmvMiB3QH9A9ulw0E5eNToJod3NlWxdlvBVfKSMR9FR2MvTrdJrZZHZw== MIME-Version: 1.0 X-Received: by 10.107.162.82 with SMTP id l79mr2015991ioe.193.1463507198845; Tue, 17 May 2016 10:46:38 -0700 (PDT) Sender: php@golemon.com Received: by 10.36.9.67 with HTTP; Tue, 17 May 2016 10:46:38 -0700 (PDT) X-Originating-IP: [107.198.91.68] In-Reply-To: <66d7fe0f-6c0b-c6c0-f30a-a54ccd10e949@gmail.com> References: <66d7fe0f-6c0b-c6c0-f30a-a54ccd10e949@gmail.com> Date: Tue, 17 May 2016 10:46:38 -0700 X-Google-Sender-Auth: WOKULGa75IjTrTdZ3JCtVUed3Ys Message-ID: To: Rowan Collins Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Pipe Operator From: pollita@php.net (Sara Golemon) On Tue, May 17, 2016 at 4:14 AM, Rowan Collins wrote: > On 17/05/2016 11:55, Jesse Schalken wrote: > $id > |> StringList::decode($$) > |> array_replace($$, $replace) > |> StringList::encode($$) > |> $id; > > > Sara, what do you think of this tweak, and my subsequent suggestion that the > pipe should only be usable as a *statement*, not an *expression*? > I'm not strictly against it, but I'm not a huge fan. Primarily, it's the statement-only restriction that bothers me since (apart from control flow structures), most constructs in PHP are expressions, not statements, and this feature naturally fits in the composable expressions category, not the top-level statement category. From an implementation standpoint, I'm fairly confident that the patch would be much more complex as a result of enforcing that statement-only requirement. Meanwhile, if we remove the statement-only requirement, then using "simple-variable" as a signal to switch to expression termination, then we introduce a whole class of bug where a user fat-fingers the $$ token in what SHOULD be another link in a chain expression, but it's not detectable as an error because a simple-var is valid. And one more counter-example: $x |> foo($$) |> $y[$$]; This is no longer a simple var, should that terminate our statement by writing to $y[$$]? Or should that be seen as the next link in a chain where we read the value from $y[$$] (which could well have getter side effects)? I would probably expect the latter, but maybe the former was intended? So yeah, I'm really not a fan. That said, if enough other people chime in that they think these issues are surmountable in "a PHP way", then I'll take a crack at a PR and we can include it in the discussion, but as-is.... I can't quite get behind it. -Sara