Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93129 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3510 invoked from network); 9 May 2016 18:01:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 May 2016 18:01:13 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.182 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.182 mail-pf0-f182.google.com Received: from [209.85.192.182] ([209.85.192.182:35558] helo=mail-pf0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/93-10422-760D0375 for ; Mon, 09 May 2016 14:01:12 -0400 Received: by mail-pf0-f182.google.com with SMTP id 77so78314575pfv.2 for ; Mon, 09 May 2016 11:01:11 -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=dtrSi/u/lsR4yIFsV+YvnKbp6bTgnpwNIkMYFdw+KZc=; b=SdvjxIfRPQW0eatARBods+twypv9hiHS9dbxvr1U+xtB5Z8gVc6pdazEySuO+BEP4Y sViiSBlbn0ibAoFx57Wj6Ri19Tz1qFPNd9jdyUkDwFJhRB7nobgJ+SeIV/BbMJUt16W9 WM2huFhUDu2SYgEp2N4QRpuQqidud8YgKd8tI3x7bPjwgFxu3Jde+VR7VYIoSpsmuzwJ HMpBR31nShk3bEUkmCDTAR59IB/k4+im0lXOgBR5rvnD9wN4Ub2RuCyfcSLVqwrb05AL G5RzMAxH6hC74zTMkRm6ISXT5HmQwOCj4rHeMP7gzIrYSg+qCDiQMC4hbOe4mfUZEpqG n5oA== 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=dtrSi/u/lsR4yIFsV+YvnKbp6bTgnpwNIkMYFdw+KZc=; b=I+nQHMLIdvlTN/oujDOKiWY/3kHWNhISPgwpCLSyYekIW0fsVeFpQ1BfhJ/rcez9Xb YlIGJuzZWK2Afxh7vhQVnqhbiVCCic5hHJVpCqxD4FxRqtJISfkv12gOyxZpF4d3AJ8/ 3nyfyXUhPBTCoCawY5A7D9TNtTVS97dYtVyMsnB/5g1NQnrb5GtnDjVOqa7M6QpS3VgK +QGSCaehFGCXq2pjKs+yebQv1yr4EptzDorY+QiOyP9kavklA2fzgnmMMQU90u78/qLm 8E9ng0lcdVH79Fu9DpkVmk4+OpXghldEwGAd9NjR1jbCWqZ8BIEHItCcHGAP/EXTWSkG HRlA== X-Gm-Message-State: AOPr4FWl7OwvSrff19leEOuXC/JYtFgd1Yz1UZnS8221+szVlkyWMoHblB5i9iOqwhudCQ== X-Received: by 10.98.38.130 with SMTP id m124mr52198544pfm.14.1462816868431; Mon, 09 May 2016 11:01:08 -0700 (PDT) Received: from ?IPv6:2602:304:cdc2:e5f0:795b:99e1:833d:f333? ([2602:304:cdc2:e5f0:795b:99e1:833d:f333]) by smtp.gmail.com with ESMTPSA id b19sm42085904pfj.41.2016.05.09.11.01.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2016 11:01:06 -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> <452ddb93-1f47-1d0f-4f24-bedbff506b27@gmail.com> Cc: "internals@lists.php.net" Message-ID: Date: Mon, 9 May 2016 11:00:52 -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! > You lack imagination. Here's three to get you started: > > Elixir: http://elixir-lang.org/getting-started/enumerables-and-streams.html#the-pipe-operator > F#: https://msdn.microsoft.com/en-us/library/dd233229.aspx#Anchor_11 > Clojure: https://clojuredocs.org/clojure.core/-%3E > > And if they seem to obscure, how about this proposal for Javascript? > https://github.com/mindeavor/es-pipeline-operator Thanks, now I know where it comes from. This would be useful to mention in the RFC. Note the interesting difference - none of them has $$. This construct seems to be much more natural in functional languages (which all of the above are) due to the fact that functions there are more designed for combining, currying, being composed, operated on, etc. > $foo->bar() calls the bar() method invisibly passing $foo as its Explicitly calling method bar on $foo seems to be strange definition of "invisibly". $this (in all it's forms) is a basic concept of OOP. > $foo |> bar($$) calls the bar() method quite visible passing $foo as > its explicitly non-hidden first argument. Visible passing is bar($foo). We don't need another syntax for it. For |> it's not passing of $foo - it's passing of $$. Which needs to be a) figured out what that magic $$ means (note that none of the languages above have magic variables there) and b) located where the value for magic $$ comes from. > The pipe call is clear and easily traces, the object call requires > understanding OOP. I'll grant that OOP is much more common, and > therefore generally understood by individuals who already know OOP (as > tautologous as that statement is). The problem is that, as I see it, pipe call *doesn't* easily trace, especially with addition of $$. As I mentioned already, this code also would be hard to debug. -- Stas Malyshev smalyshev@gmail.com