Issue #15799 has been updated by zverok (Victor Shepelev).


```ruby
1.. |> take 10 |> map {|x| x*2} |> (x)
```

I believe that the ONLY sane reason for the new operator is ending the long chain with "...and now, put it into variable". The rest is total mistery, however you look at it, e.g. why not 
```ruby
(1..).take(10).map {|x| x*2}
```
...that's perfectly readable and usual Ruby, why rip the Elixir? 

> As a side note, I became less wanting for the feature "...and not put it into variable" since introduction of `then`, because you always can 
```ruby
(1..).take(10).map {|x| x*2}
  .then { |res| 
     #...work with the result
  }
```

But **if** "...and now put it into a variable" is necessary, why not reuse `=>`? It is invalid syntax currently (without braces), and would be consistent with `rescue Foo => x` and the same use in a new pattern-matching.

So the result would be
```ruby
(1..).take(10).map {|x| x*2} => x
```

----------------------------------------
Feature #15799: pipeline operator
https://bugs.ruby-lang.org/issues/15799#change-78255

* 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/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>