Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94633 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1649 invoked from network); 22 Jul 2016 15:05:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2016 15:05:38 -0000 Authentication-Results: pb1.pair.com header.from=david.proweb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=david.proweb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.179 as permitted sender) X-PHP-List-Original-Sender: david.proweb@gmail.com X-Host-Fingerprint: 209.85.220.179 mail-qk0-f179.google.com Received: from [209.85.220.179] ([209.85.220.179:34300] helo=mail-qk0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 21/22-24343-24632975 for ; Fri, 22 Jul 2016 11:05:38 -0400 Received: by mail-qk0-f179.google.com with SMTP id o67so103675735qke.1 for ; Fri, 22 Jul 2016 08:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=D8ltZl5IdIrCn3RC3+brpA1VHdORc4KNgHsin8XKiC8=; b=O9wBdQlhfCQjs6NmsXaKt4DQf852L+4BckjKR8hn0GYNDybmLM62ElmsdZlvMGxCSo v6RKofHeV9TjnsUbv1KMceK2KvYjY9kjzHLkZP0ZiONUrqRLlvW+VKw5lLMf0pteXHJW RTCy771QrGTTn62mWRXFg8Ft+V50/pYLTLH/fWS7sOCan8bgiLKTjU8zv/cPdGiKGngY 1xaKFzdcTE+mv76TNKw6qYYLA1jKmRpgLpLFbb7rJd9KePCiYD2rKdqVYQX1n9S/rMTT hk0lQalH9qLyKoO55qXXwZnZ0oIEvX4AoAHK9QvPKl2IYDw5BfxgjcsMj34+dDPQCUQM 7I/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=D8ltZl5IdIrCn3RC3+brpA1VHdORc4KNgHsin8XKiC8=; b=ZC9gJcaFWjORGlVyiHYaONa51o/v2r23x4mqfj1FmAG1r1GBgUvdYYWAPRmfi++EH4 DGfAgNLrQhZ42YlE/4tNsB6V+wgXuBFxzuT+tWHeOkEm1+IhJq9d9rZvxGTZZ0aXtphE 9ryvYSz2X+myzpsPbLcNoz79fb+RJAuNJKycxa5tQDDggL+NWF1vF6O1OwAnVviBIHv8 xHARyVqlDWy3I0zhRIJodH+Z+wUl4XKDGwjTWFmkCPXLmHl4+6iIYBN3NfxLFA81U+CW 97EdFCAYkPPqRB9dgScb/3duF6xEKPJBqzUiTaXWJU8secOHl2nmIMr0GZh/vPRYvSBZ aInA== X-Gm-Message-State: AEkoouu5Da6VOfEJDMjyaCIV2S8ci0AS86osFmE4k0FIi7+7FFZrNiIPR1Z1TnW6EJRSQ/d6vRq+5/86TwpSKg== X-Received: by 10.55.75.207 with SMTP id y198mr4942861qka.57.1469199935738; Fri, 22 Jul 2016 08:05:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.45.67 with HTTP; Fri, 22 Jul 2016 08:05:16 -0700 (PDT) In-Reply-To: References: <71557808-5718-0406-3df9-830bc2e03006@gmail.com> <5024e8b2-4a4d-4a12-99f3-a539c9930337@gmail.com> Date: Fri, 22 Jul 2016 12:05:16 -0300 Message-ID: To: Sara Golemon Cc: Rowan Collins , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Pipe Operator v2 From: david.proweb@gmail.com (David Rodrigues) It's possible to use the tilde ~ easyly on keyboards? For on BR/ABNT2 is easy. So maybe use ~> as operator could be fine, instead of the triangle |>, and linear sounds good too, like: $string~>escape($$)~>dump($$); It's used currently on PHP for a bitwise operation (not), so I think that the usage are not a problem in general. Too will not have a conflict, because ~> no make any sense to PHP today. 2016-07-22 2:52 GMT-03:00 Sara Golemon : > On Thu, Jul 21, 2016 at 2:56 PM, Rowan Collins wrote: >> On 21/07/2016 22:28, Sara Golemon wrote: >>> >>> Are you picturing the return statement returning from the current >>> function? Or "returning" from the current pipe chain? >>> >>> I think you mean the former, in which case I'd ask how that'd better/worse >>> than: >>> >>> return foo() |> bar($$); >> >> I do indeed mean returning from the current function. I went into more >> detail (perhaps too much!) on the previous thread, but the basic premise is >> the pipe operator gives you code that reads left to right. Adding an element >> where you have to jump back to the beginning of the expression feels like it >> defeats that. >> > Ah! I understand your point now. Indeed, in terms of code-scan, > there's something of a whiplash effect going on. Now I understand the > motivation behind $> assignment and/or using a terminal like `return > $$` at the end. > > Adding in support for some terminals (like return) could make sense, > it's an exception to a rule, but it's a reasonable looking one (at > first glance, anyway). > > The assign to var at the end however, is something I'd rather handle > with the following: > > foo() |> bar($$) |> $baz = qux($$); > > Which is both legal with the syntax as-is, and entirely readable > without adding an extra operator. > > -Sara > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- David Rodrigues