From: XrXr@... Date: 2019-10-30T23:11:25+00:00 Subject: [ruby-core:95596] [Ruby master Feature#16275] Revert `.:` syntax Issue #16275 has been updated by alanwu (Alan Wu). `.:` has special power in that one cannot change its semantics by redefining a method. It other words, it's a fundamental operation in the language like `class << object` and `def object.method_name; end`. I think a fundamental operation should only be introduced if there is a good supporting ecosystem for it in the language. I see reverting as a move to take a step back and do more design thinking about functional programming and how it fits in with the rest of the language. With a good ecosystem behind it, `.:` could be much more powerful than just a shortcut. On the other hand, keeping `.:` could be a way to crowd-source the design process. @zverok already has some tickets that depend on `.:` for expanding the FP part of Ruby. If `.:` hits a mainline release, more people could come forward with ideas to gradually make `.:` less orphan and more powerful. In the worst case scenario, no new paradigm is explored and we are left with a syntactic sugar for an unpopular operation, I don't know if that is an okay risk. When it comes to primitive operations, less is more, so I think we should revert for now. ---------------------------------------- Feature #16275: Revert `.:` syntax https://bugs.ruby-lang.org/issues/16275#change-82386 * 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: