From: nobu@... Date: 2019-07-29T08:31:53+00:00 Subject: [ruby-core:93992] [Ruby master Feature#15921] R-assign (rightward-assignment) operator Issue #15921 has been updated by nobu (Nobuyoshi Nakada). nobu (Nobuyoshi Nakada) wrote: > ioquatix (Samuel Williams) wrote: > > If it's not clear, previous statement is evaluated like: > > > > ```ruby > > (Users.where(active: true) => active_users).where(type: "admin") => admin_users > > ``` > > It can't be higher precedence than `.`, or it will conflict with other syntaxes too much. You may be able to use `|>` here. ```ruby Users.where(active: true) => active_users |> where(type: "admin") => admin_users ``` ---------------------------------------- Feature #15921: R-assign (rightward-assignment) operator https://bugs.ruby-lang.org/issues/15921#change-80187 * Author: nobu (Nobuyoshi Nakada) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: ---------------------------------------- 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: