From: merch-redmine@... Date: 2019-10-23T18:04:42+00:00 Subject: [ruby-core:95510] [Ruby master Feature#16275] Revert `.:` syntax Issue #16275 has been updated by jeremyevans0 (Jeremy Evans). I am in favor of removing `.:`. It was introduced before numbered parameters, but I think using numbered parameters is better than using `.:` for solving the same problems `.:` is designed to solve: ```ruby %w'file1 file2'.map(&File.:read) %w'file1 file2'.map{File.read(_1)} %w'file1 file2'.map(&File.:read << 'dir/'.:+) %w'file1 file2'.map{File.read('dir/'+_1)} ``` nobu (Nobuyoshi Nakada) wrote: > It is not just for ���the functional programming style���. > Originally it was to extract the exact method even if `obj.method` was overridden. You can use `::Kernel.instance_method(:method).bind_call(obj, :method_name)` if you really need this if `obj.method` is overridden. That's definitely more verbose, but I don't think this need is common enough that we need a shortcut for it. ---------------------------------------- Feature #16275: Revert `.:` syntax https://bugs.ruby-lang.org/issues/16275#change-82286 * Author: naruse (Yui NARUSE) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- `obj.:method` is introduced at r66667 by #12125 and #13581. It encourages the functional programming style in Ruby. But this shorthand syntax is just for methods of `self` without arguments. It causes another feature requests like #16273 (and lambda compositions like #15428). Such features will introduce a new view of Ruby but no one illustrates the whole picture yet. I worried about such patch work may cause a conflict with future expansion of functional programing style or a just a garbage feature. `.:` syntax is introduced in 2.7.0 preview1, not released in production yet. How about reverting at this time and re-introduce with a big picture. -- https://bugs.ruby-lang.org/ Unsubscribe: