From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.8 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 990E51F453 for ; Sat, 27 Apr 2019 13:23:12 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 29C2A120972; Sat, 27 Apr 2019 22:23:07 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id EFBCB12092C for ; Sat, 27 Apr 2019 22:23:04 +0900 (JST) Received: by filter0148p3mdw1.sendgrid.net with SMTP id filter0148p3mdw1-22124-5CC457B9-F 2019-04-27 13:23:05.391086096 +0000 UTC m=+147696.846180330 Received: from herokuapp.com (unknown [54.234.188.196]) by ismtpd0006p1iad2.sendgrid.net (SG) with ESMTP id muJHJ1kmTLuN_qPGmGsN9g for ; Sat, 27 Apr 2019 13:23:05.366 +0000 (UTC) Date: Sat, 27 Apr 2019 13:23:05 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 67919 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15799 X-Redmine-Issue-Author: nobu X-Redmine-Sender: Eregon X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr1A6EMfY35W0t0TIc43MS?= =?us-ascii?Q?tGHB5ooQpb8sXfwhjinhWOpP1jBF9=2FX8gegwL9j?= =?us-ascii?Q?+L8IL+3yqnhsMx8VzxXZOA6U89jXuqsclE01Vtr?= =?us-ascii?Q?UEKjWdlfuCZUEDvTMvwP07737NbEdfuOMwAwufK?= =?us-ascii?Q?v+J1bTtUFTe97tEqTSgpD2P35uK9abjaHpw=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92436 Subject: [ruby-core:92436] [Ruby trunk Feature#15799] pipeline operator X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15799 has been updated by Eregon (Benoit Daloze). My early thinking about this syntax is it's a very narrow use-case. Is it anything more than `.` and no need for parentheses in some rare cases? There is also the RHS assignment which feels very unnatural to me. I think there is nothing wrong with having parentheses for Range, I think they actually help readability. Martin's desugared version which works today is actually shorter and I believe most would agree it's also clearer. To be fair, I don't particularly like Haskell code and find it very cryptic, which this is getting closer to. Also, if we actually introduce a pipeline operator, I think it's much more useful to have Elixir semantics of passing the result as the first argument of the RHS, than just a different syntax for `.`. ---------------------------------------- Feature #15799: pipeline operator https://bugs.ruby-lang.org/issues/15799#change-77790 * Author: nobu (Nobuyoshi Nakada) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Implemented the pipeline operator `|>`, a topic of "ruby committers vs the world" in RubyKaigi 2019. Also a casual idea of rightward assignment. ```ruby 1.. |> take 10 |> map {|x| x*2} |> (x) p x #=> [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] ``` https://github.com/nobu/ruby/tree/feature/pipeline -- https://bugs.ruby-lang.org/