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


jballanc (Joshua Ballanco) wrote:
> If we remove the ability to call methods with (({::})), then the class definition lines don't match as nicely:
> 
>     class Baz < Foo::Bar
>     ...
>     class Quux < Foo.Bar("Howdy")
>     ...
> 
> Though I'd be interested to hear Mr. Evans opinion, since I think Sequel is where I've seen this used to the greatest effect...

I'm against removing it, since I think there are places where the syntax looks nicer with :: (constructors such as Sequel::Model() and Nokogiri::XML()).  Having only one way to do something for its own sake is not the ruby way, and I think the loss of backwards compatibility and nicer syntax outweighs the reduced confusion.  I don't train new ruby programmers, though, so maybe I underestimate the confusion this causes.
----------------------------------------
Feature #8377: Deprecate :: for method calls in 2.1
https://bugs.ruby-lang.org/issues/8377#change-39253

Author: charliesome (Charlie Somerville)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: current: 2.1.0


=begin
(({::})) is usually a constant lookup operator, but it can also be used to call methods. This can confusing to people learning Ruby.

I propose deprecating (({::})) as a method call operator in Ruby 2.1, then removing it in 2.2 (or whichever version comes after 2.1).

As part of the deprecation, Ruby's parser should emit a warning whenever (({::})) is used as a method call operator. This warning should be emitted even if (({-w})) is not enabled.
=end


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