ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:95502] [Ruby master Feature#16275] Revert .: syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
@ 2019-10-23 15:26 ` naruse
  2019-10-23 16:50 ` [ruby-core:95505] [Ruby master Feature#16275] Revert `.:` syntax nobu
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: naruse @ 2019-10-23 15:26 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been reported by naruse (Yui NARUSE).

----------------------------------------
Feature #16275: Revert .: syntax
https://bugs.ruby-lang.org/issues/16275

* 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 introduce 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95505] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
  2019-10-23 15:26 ` [ruby-core:95502] [Ruby master Feature#16275] Revert .: syntax naruse
@ 2019-10-23 16:50 ` nobu
  2019-10-23 16:51 ` [ruby-core:95506] " nobu
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: nobu @ 2019-10-23 16:50 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by nobu (Nobuyoshi Nakada).

Description updated
Subject changed from Revert .: syntax to Revert `.:` syntax

It is not just for “the functional programming style”.
Originally it was to extract the exact method even if `obj.method` was overridden.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82281

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95506] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
  2019-10-23 15:26 ` [ruby-core:95502] [Ruby master Feature#16275] Revert .: syntax naruse
  2019-10-23 16:50 ` [ruby-core:95505] [Ruby master Feature#16275] Revert `.:` syntax nobu
@ 2019-10-23 16:51 ` nobu
  2019-10-23 17:37 ` [ruby-core:95507] " shevegen
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: nobu @ 2019-10-23 16:51 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by nobu (Nobuyoshi Nakada).


Forgot the URL to revert: https://github.com/nobu/ruby/pull/new/feature/16275-revert-methref

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82282

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95507] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2019-10-23 16:51 ` [ruby-core:95506] " nobu
@ 2019-10-23 17:37 ` shevegen
  2019-10-23 18:04 ` [ruby-core:95510] " merch-redmine
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: shevegen @ 2019-10-23 17:37 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by shevegen (Robert A. Heiler).


Personally what I dislike about .: is mostly that I have to look carefully at the code
and think.

> It is not just for “the functional programming style”.
> Originally it was to extract the exact method even if obj.method was overridden.

I think that the idea behind .: is ok but syntax-wise I am not sure if it is good
to have it in that way. Naruse actually made another point, though, even if the
other statement was not entirely correct, in the sense that he referred to proposals
that may be in conflict/competition with the syntax - see zverok's suggestion for
e. g. &.: or something like that; and I am not quite liking the ideas that spawn off
from other prior ideas here, simply syntax-wise alone. Even though that may be 
subjective due to a personal evaluation (as style preferences may differ between
individuals).

It also taps a bit into what Martin Duerst said some time ago about presenting or
using some unified approach, idea and framework for functional programming and
ideas originating from here. With many disparate, individual suggestions that
may partially "block" one another, it may indeed be difficult to use something
more unified and streamlined. So from that point of view, I think naruse's 
comment may be a good comment too, irrespective of the initial statement which
may not be the primary case/cause. (Although I also understand that his 
comment was not necessarily about preferences in regards to liking or 
disliking .: as such)

Syntax-wise in general oldschool ruby put up a high barrier as a "standard". :)
Syntax may not be the only or a primary area of concern when there are 
competing suggestions for new features and new behaviour, but I think 
that syntax is also quite important in general.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82283

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95510] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2019-10-23 17:37 ` [ruby-core:95507] " shevegen
@ 2019-10-23 18:04 ` merch-redmine
  2019-10-23 18:29 ` [ruby-core:95511] " daniel
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: merch-redmine @ 2019-10-23 18:04 UTC (permalink / raw)
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95511] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2019-10-23 18:04 ` [ruby-core:95510] " merch-redmine
@ 2019-10-23 18:29 ` daniel
  2019-10-23 23:19 ` [ruby-core:95518] " mame
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: daniel @ 2019-10-23 18:29 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by Dan0042 (Daniel DeLorme).


I'm also in favor of removing `.:` until a better "whole picture" is formed. Besides, that syntax encourages the idea that symbols are closely related to functional objects. And it looks like cuneiform.

For example, if we consider that `->` is a functional syntax for lambdas, we could adopt the '>' character as a common element of functional syntax in general. Below is a _very hypothetical_ example just to show that a whole-picture view could possibly lead to different results:

```
potential functional operators
!>      
&>      
(>      
*>      
+>      
,>      
->       lambda
/>      
:>word   :word.to_proc    
;>      
<>      
@>       
[>      
\>      
^>      
`>      
{>      
|>       pipeline
~>word   obj.method(:word)
~~>word  obj.instance_method(:word)

conflict / already used
">  string
'>  string
#>  comment
$>  stdout
%>  string
)>  greater-than
.>  greater-than
=>  hash literal
>>  right shift
?>  erb
]>  greater-than
}>  greater-than
```

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82287

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95518] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2019-10-23 18:29 ` [ruby-core:95511] " daniel
@ 2019-10-23 23:19 ` mame
  2019-10-24  1:33 ` [ruby-core:95521] " shannonskipper
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: mame @ 2019-10-23 23:19 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by mame (Yusuke Endoh).


+1 for the removal of `.:`.

> Originally it was to extract the exact method even if obj.method was overridden.

I think that it was just one of the motivations of that.  Anyway, people will mainly (ab)use it like `.map(&JSON.:parse)`.  I don't like this style.  It is ad-hoc, incomplete, not composable, just hacky, and even complicated.

I'm currently thinking that the following design is preferable.

* A plain old style should be the base: `.map {|x| x.to_s(16) }` `.map {|x| JSON.parse(x) }`
* A numbered parameter makes simple cases simpler: `.map { _1.to_s(16) }` `.map { JSON.parse(_1) }`
* #16120 is worth reconsidering which makes typical case rather simpler: `.map { .to_s(16) }` (and this style is more flexible than the current `.map(&:to_s)`)
* `.map(&:to_s)` should be deprecated

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82292

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95521] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (6 preceding siblings ...)
  2019-10-23 23:19 ` [ruby-core:95518] " mame
@ 2019-10-24  1:33 ` shannonskipper
  2019-10-24  6:03 ` [ruby-core:95526] " zn
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: shannonskipper @ 2019-10-24  1:33 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by shan (Shannon Skipper).


I've already fallen into using ` .:` in 2.7. I'd personally miss `.:` since it feels super natural to me.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82294

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95526] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (7 preceding siblings ...)
  2019-10-24  1:33 ` [ruby-core:95521] " shannonskipper
@ 2019-10-24  6:03 ` zn
  2019-10-24 11:26 ` [ruby-core:95531] " eregontp
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: zn @ 2019-10-24  6:03 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by znz (Kazuhiro NISHIYAMA).


> `?>  erb`

`?>` is a character literal.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82301

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95531] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (8 preceding siblings ...)
  2019-10-24  6:03 ` [ruby-core:95526] " zn
@ 2019-10-24 11:26 ` eregontp
  2019-10-24 14:09 ` [ruby-core:95532] " daniel
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: eregontp @ 2019-10-24 11:26 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by Eregon (Benoit Daloze).


+1 as well, it feels ad-hoc to me and rather not easy to read, and is less general than numbered parameters.
And it makes extra allocations of Method objects when there is no need.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82307

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95532] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (9 preceding siblings ...)
  2019-10-24 11:26 ` [ruby-core:95531] " eregontp
@ 2019-10-24 14:09 ` daniel
  2019-10-24 18:45 ` [ruby-core:95534] " manga.osyo
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: daniel @ 2019-10-24 14:09 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by Dan0042 (Daniel DeLorme).


mame (Yusuke Endoh) wrote:
> I'm currently thinking that the following design is preferable.
> 
> * A plain old style should be the base: `.map {|x| x.to_s(16) }` `.map {|x| JSON.parse(x) }`
> * A numbered parameter makes simple cases simpler: `.map { _1.to_s(16) }` `.map { JSON.parse(_1) }`
> * #16120 is worth reconsidering which makes typical case rather simpler: `.map { .to_s(16) }` (and this style is more flexible than the current `.map(&:to_s)`)
> * `.map(&:to_s)` should be deprecated

I agree with all the above. And if you can get Matz to reconsider #16120 nothing could make me happier :-)
But since I prefer `map(&:to_s)` to `map{_1.to_s}`, deprecating the former without #16120 would be rather painful.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82308

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95534] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (10 preceding siblings ...)
  2019-10-24 14:09 ` [ruby-core:95532] " daniel
@ 2019-10-24 18:45 ` manga.osyo
  2019-10-25 14:42 ` [ruby-core:95547] " zverok.offline
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: manga.osyo @ 2019-10-24 18:45 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by osyo (manga osyo).


`p obj.:hoge` can output source location of `#hoge` (with [#14145](https://bugs.ruby-lang.org/issues/14145)).

```ruby
p obj.:hoge
# => #<Method: X#hoge ../ruby/test.rb:4>
```

I was looking forward to seeing this because it is very useful when checking the source location of a method during debugging(especially with in irb).
It is sad that `.:` syntax is reverted.
However, I agree to use Numbered parameters rather than `.:` for block arguments.


----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82310

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95547] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (11 preceding siblings ...)
  2019-10-24 18:45 ` [ruby-core:95534] " manga.osyo
@ 2019-10-25 14:42 ` zverok.offline
  2019-10-25 18:37 ` [ruby-core:95549] " daniel
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: zverok.offline @ 2019-10-25 14:42 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by zverok (Victor Shepelev).


OK, with several core team members agreeing on this (and even PR prepared), I believe this is already a lost cause, but I'd still like to put some perspective here, if just for reference and future discussion.

> Disclaimer: This matters are somewhat personal for me, I was between the people pushing for "method reference operator", and one of the tickets @naruse references from the phrase "It causes another feature requests ..." is written by me (and another one is pretty close to one of my recent tickets: #16264). Despite this, I am trying to the best of my judging to focus on Ruby's consistency, evolution, and prosperity, not "I want them to merge *my* tickets!" stance.

So...

1. The idea that "the new feature causes people to think of new feature requests" is a **bad** thing, seems a bit unusual. It seemed to me that this is how the *good* design happens: we investigate where current language's syntax and semantic leads us, what new ideas emerge, and what *upcoming* ideas those new ideas produce. So, "this feature leads to thinking about new ways of language usage" seemed a sign of "something right".
2. Ruby's design process is known to be opaque (unevenly split between public discussions, closed meetings, and some particular person-in-charge decisions), but till this moment, I had an unfortunate belief at least part of it happens in this tracker. Probably, this is a false belief.
3. For example, following this belief, I am creating probably an awful lot of proposals, expecting to not only receive "accepted"/"rejected", but clarify understanding of what is in line with language's goals and intuitions. For more particular example, here: #16264 I am not only proposing some new syntax/class, which could be good or bad, but also trying to state some general design ideas, which seem to me *generally applicable*, and have a (slight already) hope to discuss them with core team—because I don't know any other place to do so.
4. That's why the claim of "not having the whole picture" was a big surprise: previously, I hoped that *discussions in this tracker* is the way of formulating the "whole picture", and, even more bold, that what's forming with new method reference operator **is**, in fact, a part of clearly visible picture of "gradually yet consistently moving towards functional Ruby". Now, it is a mystery to me whose right and responsibility is to own "the whole picture": is it a closed group of dev. meeting attendants? Matz's very own? Some dedicated "design manager of upcoming functional features"?
5. Another big surprise here is how unanimous the aversion for the new operator seems to be. On the previous iteration (when it was about to be introduced) it seemed to me that everybody agrees that it is an obvious and useful thing (method references as a first-class construct), and the only stumbling block is which characters to use for it, with `.:` being a reasonable compromise. But now a lot of people are suddenly against it (and, the funniest thing is, all for different reasons: "ad-hoc", "don't like how it looks", "numbered parameters is better"), with "method references" believed to, I don't know, esotheric and useless concept?
6. About numbered paramaters: I know it sounds bold, but I do believe it is the most useless new feature syntax-wise for several latest releases. My justification is exactly symmetrical with @naruse's: this is an "orphan" feature, which is "just nice shortcut", but it doesn't lead to any new ideas, any new possibilities, and increases language's syntax surface without increasing language's power. I believe the feature increases the language's power when it encourages new thinking. This way, method reference encourages clearer APIs suitable for passing arguments that belong to API, e.g. redesigning `map { |x| MyService.method(x, lot, of, options) }` into `map(&configured_service.:method)`, thinking when and how we pass `lot, of, options`; while numbered parameters allow preserving *exactly* the same thinking as before, just spare some keystrokes with `map { MyService.method(_1, lot, of, options) }`
7. I understand there are generally two camps when we talk about language design: one that feels current design is more or less "final", just implementation can be improved (but maybe some small "shortcuts" are allowed); and one that feels that language is a living thing, and constantly picking existing concepts to understand what new ideas they can lead to is necessary. Obviously, numbered parameters belong to "first camp thinking", and method references to the second. It is sad that the core team currently tend to stay in the first camp, yet completely understandable.
8. With this being said, I am grateful to this situation: at least, it allowed me to seriously reconsider my involvement with the language and its future.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82323

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95549] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (12 preceding siblings ...)
  2019-10-25 14:42 ` [ruby-core:95547] " zverok.offline
@ 2019-10-25 18:37 ` daniel
  2019-10-25 23:28 ` [ruby-core:95556] " tim
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: daniel @ 2019-10-25 18:37 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by Dan0042 (Daniel DeLorme).


@zverok I really feel your pain, I had the same reaction when some of my ideas were ignored or rejected; that never feels good, especially so if you strongly believe to be right. Just take a bit of distance, don't take it personally, remember that it's human nature to resist change and that "if your ideas are any good, you'll have to ram them down people's throats". This is going to be true anywhere.

This is my personal opinion but it seems (wishful thinking?) shared by many here: The idea behind `.:` is fundamentally good but the syntax is going in the wrong direction. The `map(&:to_s)` syntax was a hack to begin with. Matz himself doesn't even like it. `obj.:method` and `.:method` go in the same direction of associating symbols with functional/callable objects and that doesn't feel right to me, even though the basic idea/purpose seems good. What originally seemed a reasonable compromise is looking less and less so.

You are entirely correct that "discussions in this tracker is the way of formulating the whole picture", and precisely in this case the whole picture that is starting to emerge feels... off. It's not a problem that a "new feature causes people to think of new feature requests", but the new features feel imperfect and those aditional feature requests feel like compounding the imperfectness, and that's more of a problem. And the worry is that once `.:` goes out in 2.7 it will be pretty much impossible to go back. Rather than adding this feature and see where things go from here (a.k.a. "ad-hoc"), I feel it's better to backtrack for now and try a slightly different path. And maybe come back to this syntax later, who knows.


TL;DR I believe the opposition here is mostly to the specific syntax and its ensuing repercussions, not the idea behind it.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82325

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95556] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (13 preceding siblings ...)
  2019-10-25 18:37 ` [ruby-core:95549] " daniel
@ 2019-10-25 23:28 ` tim
  2019-10-26  2:44 ` [ruby-core:95558] " daniel
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: tim @ 2019-10-25 23:28 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by timriley (Tim Riley).


# Ruby big comment -- 26 Oct 2019

I’m opposed to this reversion. I was looking forward to using `.:` in 2.7. I felt I should say this as a representative of perhaps a “silent majority” of Ruby users. 

I think that some of the additional ideas this feature was spawning (i.e. some of the other tickets referenced above) were potentially very helpful evolutions of the language. 

Regarding the point that a feature like `.:` should wait until it comes out as part of a “whole picture,” how is that meant to happen when contributors like zverok are locked out of the development process, as he has questioned in his comment? Would the Ruby core team really be accepting of a whole family of multiple related features coming into a release all at once? That feels unlikely to me, especially given zverok and the other key drivers of these ideas do not have access to some of the avenues for development discussion outside of this bug tracker. So their best bet is to introduce the smaller features one by one - the initial parts of the “whole family” a which is what they’ve done with `.:`.

So where does this leave this area for improvement to Ruby? If `.:` is rejected now, it feels like it closes off this evolutionary branch of language features for good. Which, imo, is anything but good.


----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82334

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95558] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (14 preceding siblings ...)
  2019-10-25 23:28 ` [ruby-core:95556] " tim
@ 2019-10-26  2:44 ` daniel
  2019-10-26  7:02 ` [ruby-core:95560] " merch-redmine
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: daniel @ 2019-10-26  2:44 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by Dan0042 (Daniel DeLorme).


matz (Yukihiro Matsumoto) wrote:
> I am for adding syntax sugar for method reference. But I don't like proposed syntax (e.g. ->).
> Any other idea?

> Out of [ruby-core:85038](https://bugs.ruby-lang.org/issues/13581#change-69758) candidates, `.:` looks best to me (followed by `:::`).
> Let me consider it for a while.

So clearly the syntax sugar for method reference is something that we *will* have. Eventually if not now.
After the "let me consider", nobu implemented it with `.:` but was there ever a final word from Matz?

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82336

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95560] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (15 preceding siblings ...)
  2019-10-26  2:44 ` [ruby-core:95558] " daniel
@ 2019-10-26  7:02 ` merch-redmine
  2019-10-26  7:17 ` [ruby-core:95561] " nobu
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: merch-redmine @ 2019-10-26  7:02 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by jeremyevans0 (Jeremy Evans).


timriley (Tim Riley) wrote:
> I’m opposed to this reversion. I was looking forward to using `.:` in 2.7. I felt I should say this as a representative of perhaps a “silent majority” of Ruby users. 

If you think your opinion represents the "silent majority" of Ruby users, I think you are operating in an echo chamber.  I realize the this feature may fit nicely into the dry-rb projects, but you should realize that users of dry-rb are probably not representative of the average Ruby user. I don't want to pick on you personally, but please do not pretend to speak for the majority of Ruby users.

> I think that some of the additional ideas this feature was spawning (i.e. some of the other tickets referenced above) were potentially very helpful evolutions of the language. 

Most Ruby users I have spoken too (maybe even a "silent majority" of Ruby users :) ) feel that the introductions of similar features such as `Proc#<<` and `Proc#>>` actually make the resulting code harder to read.  What is considered a helpful evolution by some users can be cryptic and harder to understand for others.

All additional syntax has costs in terms of both internal/implementation and external/cognitive complexity.  All proposals to add syntax need to consider the costs of adding the syntax, and the expected benefits of the syntax.

Regarding the tickets referenced above:

#16264: This complicates things further, and I am guessing that most Ruby users would find this approach to structuring more difficult to understand than traditional Ruby.  Do you think most Ruby users would prefer:

```ruby
paragraph_hashes.map(&.:merge.with(author: current_author))
filenames.map(&File.:read.with(mode: 'rb'))
```

to:

```ruby
paragraph_hashes.map{|h| h.merge(author: current_author)}
filenames.map{|f| File.read(f, mode: 'rb')}
```

I guess if you really hate naming block variables, and you really hate numbered parameters, maybe the former is preferable. :)

#14145: While `self.:method_name` instead of `method(:method_name)` is a bit shorter, that doesn't seem like a major reason to add special syntax, considering `inspect` is mainly used for debugging. Also, this was already committed, so the loss of `.:` will not affect it.

> Regarding the point that a feature like `.:` should wait until it comes out as part of a “whole picture,” how is that meant to happen when contributors like zverok do not have access to various key aspects of the development and decision-making process, as he has questioned in his comment? Would the Ruby core team really be accepting of a whole family of multiple related features coming into a release all at once? That feels unlikely to me, especially given zverok and the other key drivers of these ideas do not have access to some of the avenues for development discussion outside of this bug tracker. So their best bet is to introduce the smaller features one by one - the initial parts of the “whole family” a which is what they’ve done with `.:`.

I don't think we should reject this because we don't have the "whole picture".  I think we should reject this because the reason it was added is better served by another feature that is more flexible and easier for the average Ruby user to understand.  Numbered parameters handle both cases where you would use `.:` and cases where you would use the feature proposed in #16264.
 
> So where does this leave this area for improvement to Ruby? If `.:` is rejected now, it feels like it closes off this evolutionary branch of language features for good. Which, imo, is anything but good.

I don't think this closes off anything. This is just a specific feature that is independent of other features.    If there were other features in this "evolutionary branch" that improved Ruby, I think they would certainly be considered.

For example, with #16264, if `.:` was removed, I assume that `paragraph_hashes.map(&.:merge.with(author: current_author))` could still work, and `filenames.map(&File.:read.with(mode: 'rb'))` could be changed to `filenames.map(&File.method(:read).with(mode: 'rb'))`

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82338

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95561] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (16 preceding siblings ...)
  2019-10-26  7:02 ` [ruby-core:95560] " merch-redmine
@ 2019-10-26  7:17 ` nobu
  2019-10-26 12:09 ` [ruby-core:95563] " shevegen
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: nobu @ 2019-10-26  7:17 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by nobu (Nobuyoshi Nakada).


zverok (Victor Shepelev) wrote:
> OK, with several core team members agreeing on this (and even PR prepared), I believe this is already a lost cause, but I'd still like to put some perspective here, if just for reference and future discussion.

Just to be clear, that I had written the patch doesn't mean that I'm favor in the removal.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82339

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95563] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (17 preceding siblings ...)
  2019-10-26  7:17 ` [ruby-core:95561] " nobu
@ 2019-10-26 12:09 ` shevegen
  2019-10-29 11:05 ` [ruby-core:95580] " tim
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: shevegen @ 2019-10-26 12:09 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by shevegen (Robert A. Heiler).


> with several core team members agreeing on this

At the end of the day you only need to find pro/con arguments for matz. :)

Once a syntax is picked, though, it may be mutually exclusive to other syntax
and follow-up ideas building up on that syntax. I think that was one part of
the reasoning for the suggestion here.

What might perhaps help would be a separate issue/discussion for a larger
more comprehensive "functional" approach/overview in ruby, as Martin suggested
some time ago. Something like listing what ruby users may want to have, and
then looking at syntax that could fit to that approach. And to perhaps aim
for it past ruby 3.0, mostly because I think the time may become a bit 
short otherwise, since ruby 3.0 will be released in a bit over a year from
now on - matz and the ruby team probably want to make 3.0 as polished as
possible. :)

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82344

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95580] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (18 preceding siblings ...)
  2019-10-26 12:09 ` [ruby-core:95563] " shevegen
@ 2019-10-29 11:05 ` tim
  2019-10-30 23:11 ` [ruby-core:95596] " XrXr
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: tim @ 2019-10-29 11:05 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by timriley (Tim Riley).


Jeremy – I’m sorry for the overreach in that clumsy wording. Let me rephrase: what I saw here was a fair number of comments supporting the removal of an already-implemented feature of 2.7 that I felt had good potential and that I was personally looking forward to using. I wanted to make it clear that there was at least some positive anticipation for the feature from within the community of Ruby users; if I had said nothing, maybe that sentiment would’ve gone unnoticed.

As for dry-rb, I did not leave my original comment as any kind of representation from that project (which is why I did not mention it). If there’s any further misunderstanding I’d be more than happy to clarify things with you personally, outside of this ticket. Cheers :)

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82366

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95596] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (19 preceding siblings ...)
  2019-10-29 11:05 ` [ruby-core:95580] " tim
@ 2019-10-30 23:11 ` XrXr
  2019-11-05 11:38 ` [ruby-core:95694] " maciej
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: XrXr @ 2019-10-30 23:11 UTC (permalink / raw)
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95694] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (20 preceding siblings ...)
  2019-10-30 23:11 ` [ruby-core:95596] " XrXr
@ 2019-11-05 11:38 ` maciej
  2019-11-05 11:38 ` [ruby-core:95695] " maciej
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: maciej @ 2019-11-05 11:38 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by maciej.mensfeld (Maciej Mensfeld).

File Zrzut-ekranu-z-2019-11-02-17-04-12.png added

I'm also in favor of what Tim stated but at the same time, I want to point out, that the way it is now is not optimal from the performance point of view.

Ruby gives you a new instance of a `#Method` class. Even when you’re fetching the method of the same instance of an object. That’s not all. If used with the `&` operator, each of the fetched method references is later on converted into a Proc object using the `#to_proc` method. That makes the code almost 10 times slower than the "standard" one and heavily stresses out the GC. I've pointed this here already: https://bugs.ruby-lang.org/issues/16103 and here are my recent benchmarks: https://mensfeld.pl/2019/11/the-hidden-cost-of-the-ruby-2-7-dot-colon-method-reference-usage/

I would not expect the majority of Ruby programmers to know subtle details like this one (especially as those may or may not be certain Ruby implementation detail).


----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82482

* 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.

---Files--------------------------------
Zrzut-ekranu-z-2019-11-02-17-04-12.png (8.69 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95695] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (21 preceding siblings ...)
  2019-11-05 11:38 ` [ruby-core:95694] " maciej
@ 2019-11-05 11:38 ` maciej
  2019-11-13  5:23 ` [ruby-core:95829] " zverok.offline
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 26+ messages in thread
From: maciej @ 2019-11-05 11:38 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by maciej.mensfeld (Maciej Mensfeld).

File deleted (Zrzut-ekranu-z-2019-11-02-17-04-12.png)

I'm also in favor of what Tim stated but at the same time, I want to point out, that the way it is now is not optimal from the performance point of view.

Ruby gives you a new instance of a `#Method` class. Even when you’re fetching the method of the same instance of an object. That’s not all. If used with the `&` operator, each of the fetched method references is later on converted into a Proc object using the `#to_proc` method. That makes the code almost 10 times slower than the "standard" one and heavily stresses out the GC. I've pointed this here already: https://bugs.ruby-lang.org/issues/16103 and here are my recent benchmarks: https://mensfeld.pl/2019/11/the-hidden-cost-of-the-ruby-2-7-dot-colon-method-reference-usage/

I would not expect the majority of Ruby programmers to know subtle details like this one (especially as those may or may not be certain Ruby implementation detail).


----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82483

* 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/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95829] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (22 preceding siblings ...)
  2019-11-05 11:38 ` [ruby-core:95695] " maciej
@ 2019-11-13  5:23 ` zverok.offline
  2019-11-13 11:15 ` [ruby-core:95840] " matz
  2019-11-13 11:18 ` [ruby-core:95842] " matz
  25 siblings, 0 replies; 26+ messages in thread
From: zverok.offline @ 2019-11-13  5:23 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by zverok (Victor Shepelev).


> Applied in changeset git|fb6a489af2765a3b56e301adf0019af6bbad6156.

> Revert "Method reference operator"

---

> "Ruby is no longer my project. It is the Ruby community's project" —Matz (as quoted by Bozhidar Batsov)

For my 15 years of writing in Ruby, teaching Ruby, documenting Ruby, contributing to Ruby, it is the sole worst thing that happened. 
Just to summarize:

* The **feature** which is:
  * short, concise and elegant
  * doesn't conflict with any other feature
  * consistent with the rest of the syntax, and with the recent years of evolution towards functional;
  * discussed by dozens of people for multiple years (with a general agreement "it is necessary, just let's invent the best syntax for it")
  * was already merged and lived through preview-1 and preview-2
* ...was **reverted**, because:
  * some of the core team doesn't like "people invent new things basing on this feature" and it is now a bad thing
  * some of the core team just don't like it at all or don't see any value or don't like the particular syntax
* ...and it was done:
  * in a "stealth" deal-with-it manner (be aware that automatic comments "Closed via changeset" aren't sent to ruby-core mailing list)
  * without an announcement of any consensus of the core team, even post-factum one (I **can** assume it was decided on yesterday's "online meeting to confirm spec of 2.7" #16333 - but apparently "general population" doesn't deserve to know what was agreed there)
  * without explanations of the _reason_ of reverting and future of the idea (nobody needs atomic native method references? they would be in Ruby 3.0, just the syntax/consequences would be rethought? Ruby turns off from "functional" ideas altogether with awesome one-size-fits-all numbered block parameters?)
  * without comment from Matz, which such a "minor" thing probably doesn't deserve anyways, right?..

This could probably the last drop to lose interest in Ruby's evolution and governance. So be it.

Thanks for everything, anyways.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82659

* Author: naruse (Yui NARUSE)
* Status: Closed
* 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.

---Files--------------------------------
dot-colon-vs-std-benchmark.png (8.69 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95840] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (23 preceding siblings ...)
  2019-11-13  5:23 ` [ruby-core:95829] " zverok.offline
@ 2019-11-13 11:15 ` matz
  2019-11-13 11:18 ` [ruby-core:95842] " matz
  25 siblings, 0 replies; 26+ messages in thread
From: matz @ 2019-11-13 11:15 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by matz (Yukihiro Matsumoto).


@zverok Sorry if we hurt your feeling. In recent years, we have added/discussed a lot of features inspired by functional programming. But those features are not designed with a grand design. Those are rather ad hoc additions. We felt the future, more functional Ruby should be designed with the big picture of functional Ruby programming, which we lack currently.

Besides that, I don't like the specific operator (`.:`) which looks like braille.

So you don't have to consider this revert as a rejection of this whole idea, but an invitation to the next try.

Matz.

----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82674

* Author: naruse (Yui NARUSE)
* Status: Closed
* 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.

---Files--------------------------------
dot-colon-vs-std-benchmark.png (8.69 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [ruby-core:95842] [Ruby master Feature#16275] Revert `.:` syntax
       [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
                   ` (24 preceding siblings ...)
  2019-11-13 11:15 ` [ruby-core:95840] " matz
@ 2019-11-13 11:18 ` matz
  25 siblings, 0 replies; 26+ messages in thread
From: matz @ 2019-11-13 11:18 UTC (permalink / raw)
  To: ruby-core

Issue #16275 has been updated by matz (Yukihiro Matsumoto).


@zverok I should have explained the reason right after the developer meeting. Actually I was asked to do so from the other members of the meeting. Sorry for my laziness.

Matz.


----------------------------------------
Feature #16275: Revert `.:` syntax
https://bugs.ruby-lang.org/issues/16275#change-82675

* Author: naruse (Yui NARUSE)
* Status: Closed
* 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.

---Files--------------------------------
dot-colon-vs-std-benchmark.png (8.69 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2019-11-13 11:18 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-16275.20191023152613@ruby-lang.org>
2019-10-23 15:26 ` [ruby-core:95502] [Ruby master Feature#16275] Revert .: syntax naruse
2019-10-23 16:50 ` [ruby-core:95505] [Ruby master Feature#16275] Revert `.:` syntax nobu
2019-10-23 16:51 ` [ruby-core:95506] " nobu
2019-10-23 17:37 ` [ruby-core:95507] " shevegen
2019-10-23 18:04 ` [ruby-core:95510] " merch-redmine
2019-10-23 18:29 ` [ruby-core:95511] " daniel
2019-10-23 23:19 ` [ruby-core:95518] " mame
2019-10-24  1:33 ` [ruby-core:95521] " shannonskipper
2019-10-24  6:03 ` [ruby-core:95526] " zn
2019-10-24 11:26 ` [ruby-core:95531] " eregontp
2019-10-24 14:09 ` [ruby-core:95532] " daniel
2019-10-24 18:45 ` [ruby-core:95534] " manga.osyo
2019-10-25 14:42 ` [ruby-core:95547] " zverok.offline
2019-10-25 18:37 ` [ruby-core:95549] " daniel
2019-10-25 23:28 ` [ruby-core:95556] " tim
2019-10-26  2:44 ` [ruby-core:95558] " daniel
2019-10-26  7:02 ` [ruby-core:95560] " merch-redmine
2019-10-26  7:17 ` [ruby-core:95561] " nobu
2019-10-26 12:09 ` [ruby-core:95563] " shevegen
2019-10-29 11:05 ` [ruby-core:95580] " tim
2019-10-30 23:11 ` [ruby-core:95596] " XrXr
2019-11-05 11:38 ` [ruby-core:95694] " maciej
2019-11-05 11:38 ` [ruby-core:95695] " maciej
2019-11-13  5:23 ` [ruby-core:95829] " zverok.offline
2019-11-13 11:15 ` [ruby-core:95840] " matz
2019-11-13 11:18 ` [ruby-core:95842] " matz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).