From: duerst@... Date: 2020-05-08T05:13:36+00:00 Subject: [ruby-core:98213] [Ruby master Feature#15921] R-assign (rightward-assignment) operator Issue #15921 has been updated by duerst (Martin D�rst). At https://bugs.ruby-lang.org/issues/16775#change-85434, Eregon (Benoit Daloze) wrote: >>>> - Could matz and other committers clarify the motivation to introduce this? There is no pipeline operator currently so it seems of limited usage. - Changing syntax often divides the community (e.g., https://twitter.com/devoncestes/status/1256222228431228933), should we be more careful when introducing new syntax? For instance, on syntax issues matz considers to merge, he could state his intention, tweet about the proposal, let it be for at least a month and then decide (merge or not). A blog post by ruby core would be another way to trigger feedback before merging. Often it feels like a decision "out of the blue" with no clear motivation. Discussion after merging feels suboptimal because people realize they have very little chance to change anything and so just love or hate it. Being in master doesn't help much because most people won't try it, yet they can share their opinion based on code snippets using the new syntax. <<<< Developers Meeting issues are not suited for extensive discussion, so I have copied these comments here. I agree quite a bit with the suggestion in the second part, but I'm very puzzled with the first part. The "pipeline operator" is not the only syntactic construct where data flow goes from left to right. Indeed, Ruby's most basic construct, method invocation, leads to a data flow from left to right in the form of method chains. If an R-assign operator is suitable after some pipeline operator(s), it sure should be suitable after a method chain. ---------------------------------------- Feature #15921: R-assign (rightward-assignment) operator https://bugs.ruby-lang.org/issues/15921#change-85452 * Author: nobu (Nobuyoshi Nakada) * Status: Closed * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- From https://bugs.ruby-lang.org/issues/15799#change-78465, proposal of the rightward-assignment operator by `=>`. ``` $ ./ruby -v -e '(1..).lazy.map {|x| x*2} => x' -e 'p x.first(10)' ruby 2.7.0dev (2019-06-12T06:32:32Z feature/rassgn-assoc c928f06b79) [x86_64-darwin18] last_commit=Rightward-assign by ASSOC [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] ``` https://github.com/nobu/ruby/tree/feature/rassgn-assoc -- https://bugs.ruby-lang.org/ Unsubscribe: