[ruby-core:93073] [Ruby trunk Feature#15799] pipeline operator
From:
zverok.offline@...
Date:
2019-06-12 13:35:49 UTC
List:
ruby-core #93073
Issue #15799 has been updated by zverok (Victor Shepelev).
@nobu Awesome. I don't know what other's would think, but from my perspective, the feature now becomes consistent with the language and have (however small) chances to be appreciated by the public.
----------------------------------------
Feature #15799: pipeline operator
https://bugs.ruby-lang.org/issues/15799#change-78488
* 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:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>