Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93124 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64473 invoked from network); 9 May 2016 06:45:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 May 2016 06:45:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.178 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.178 mail-pf0-f178.google.com Received: from [209.85.192.178] ([209.85.192.178:33734] helo=mail-pf0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/C0-60415-F1230375 for ; Mon, 09 May 2016 02:45:51 -0400 Received: by mail-pf0-f178.google.com with SMTP id 206so72987260pfu.0 for ; Sun, 08 May 2016 23:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=jx3PDvJzJYuFdylRnjmCdW1OIvN41gxZlGAnzGx9o1c=; b=Qan+5NqQrYdCXIF4XClMMW5e/Y/bWnOPYCY4j+VW5EDVkTLeOeqFoHYmTweszTLiPe Qi24LRMkzAwfxYe4TTH0Qox3ygd+Z/hkJwHSyKTJ6yymFBDQ5iEDKRDkpef3Umcq1WUQ PG7QDvNicPsST486MyHhkLd3vggfyJFJWLYEtYMh1EVZkBSlAvJO4bVMtu4unKdzSq9h r2/2be+fk89XmvXI+BtwSZcjRsPa0JfV/f+UQvktcYyVGU2wyrpFUvBZZIY/XK5H3wvO s4qW4WNnuM2IHPRuMkuphdmYYcHGiz3S4UkVpqx7Cpp61dcuZ17DQcV72IZSjGRcir6T AQJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=jx3PDvJzJYuFdylRnjmCdW1OIvN41gxZlGAnzGx9o1c=; b=Hbwk00IRDE9BZ23L1PgsboeIsh+rj7WP20wZcMxL7vR6KmofskKUDodQveJv+qUxj8 j+yIPTLPeC3lMQmkqUtrJnIPTmghLLVaLM/3qm/AdpzjNzdEpPcT6lkjI6jwwInw6H9w YKvGy5SxtVKlm4NhHYPVD9+4RwUY+O0STQSkZ7MPJ0X0meyUxww1fyBU8qi/Jq980fAz 2gQNrndiy3JjzhoNJ64rYtb22B8HEKMqeqCM1q5vy01WVG8vpmgJUlT2qijTz0IbxmBB 2MLeFQqmBwrfQnQjbT6BH/LEKBJWx2rU8C5sBaA7yx/8qvPHGMfO5hD9v6CQeUx3CupP yfrw== X-Gm-Message-State: AOPr4FXzAFAsdzSaT8usB/StvA+DbkWl7ZKbShr2drfEujEkGig86KeIo4KlThNE5CYgQw== X-Received: by 10.98.49.133 with SMTP id x127mr46218741pfx.36.1462776348372; Sun, 08 May 2016 23:45:48 -0700 (PDT) Received: from ?IPv6:2602:304:cdc2:e5f0:6c0f:f586:3f92:3b0d? ([2602:304:cdc2:e5f0:6c0f:f586:3f92:3b0d]) by smtp.gmail.com with ESMTPSA id nz6sm37746509pab.39.2016.05.08.23.45.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 May 2016 23:45:47 -0700 (PDT) To: Sara Golemon References: <39071a01-a42c-0952-b3a8-b4769c79b56b@fleshgrinder.com> <0ac3be89-6fb4-610a-ef89-0928f264f96c@fleshgrinder.com> <71379db5-b7b8-78b3-ada5-eee34e6e22d6@fleshgrinder.com> Cc: "internals@lists.php.net" Message-ID: <452ddb93-1f47-1d0f-4f24-bedbff506b27@gmail.com> Date: Sun, 8 May 2016 23:45:36 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Pipe Operator From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Yep, that's exactly what "->" does. It's just pointless syntactic No, not really. Calling method on an object is an universally accepted phrase in many languages. True, not all of them use ->, and for some of them -> may have other meaning, but if you tell somebody at least vaguely familiar with OOP "-> is a method call operator", you're done teaching them about ->. That assuming they don't come from numerous languages where -> is the method call operator. Moreover, there's no easy and more readable way to call methods in PHP, so -> is the best way to go. Moreover, calling methods is a very frequent operation, and any time you need it, regardless of what is the circumstance, you'd use -> Neither of these is true for |>-$$ thing - it does not have any matches in any languages I can think of (maybe Perl 6 has something like that because what doesn't it have?), it captures only one particular case and it does something much better done the existing way. > Oh, sorry, we were talking about the function version of ->, my > mistake. That's a totally different thing. I'm sorry I didn't get what you meant here. "function version of ->" makes no sense to me - function version of -> is the function call itself. > Hrmmm... Did you read the RFC? It's pretty clear that the lhs > expression can be used in a lot more cases that function calls and > that it needn't be the only argument. Better read it again. Only one argument can be $$. So if you need to call two functions and pass the result of them to the third, the magic does not work anymore. If you need to do anything on any of these arguments, magic does not work anymore. If you need to do any error checking or branching, the magic does not work anymore. Did I misunderstand the RFC? Do we have $1$ and $2$ coming? Maybe, but I found no mention of it in the RFC. > That's a great reason for voting against short ternary syntax. What > the hell is "?:", anyway? That would be a good question (and there are a number of languages that omit ?: for exactly that reason) had C, C++ and Perl not existed and were not direct predecessors and influences on PHP. For the full list of languages that know what the hell is "?:" please see: https://en.wikipedia.org/wiki/%3F: Now, how long is the list of languages which know what is |>, Hack excluded? I suspect the answer is "not very". Probably not 20+ long? -- Stas Malyshev smalyshev@gmail.com