Issue #8377 has been updated by phluid61 (Matthew Kerwin).


=begin
henry.maddocks (Henry Maddocks) wrote:

 > charliesome (Charlie Somerville) wrote:
 > > (({::})) is usually a constant lookup operator, but it can also be
 > > used to call methods. 
 > 
 > Is it? I thought it was the scope resolution operator.

While I know better, my gut instinct is always to agree; and that, by contrast, (({.})) is for the receiver of a method.  For example:

  ??
  ::Kernel::Array(3)
  #=> in global namespace,
  #     in nested namespace 'Kernel',
  #       invoke method 'Array' with no receiver
  # perlish: @::Kernel::Array(3)

  ::Kernel.Array(3)
  #=> in global namespace,
  #     in nested namespace 'Kernel',
  #       invoke method 'Array' with 'Kernel' as receiver
  # perlish: @::Kernel->Array(3), or @::Kernel::Array(::Kernel,3)

However I know that's not the case; and in fact (({::})) means different things if the right-hand parameter thingy is a constant or function.  I.e. (({obj.foo})) ~ (({obj::foo()})) ~ (({obj::foo})), but (({obj.FOO})) ~ (({obj::FOO()})) ??? (({obj::FOO})), irrespective of ((|obj|)) being a Class or not.

The whole thing would be made much more clear if (({::FOO()})) and (({::foo})) were removed, and (({::})) was always only used to resolve constants.

 > charliesome (Charlie Somerville) wrote:
 > > This can confusing to people learning Ruby.
 > 
 > It depends what language you're coming from.

Unless you're coming from Ruby, I'm pretty sure it's confusing for everyone.

=end
----------------------------------------
Feature #8377: Deprecate :: for method calls in 2.1
https://bugs.ruby-lang.org/issues/8377#change-39188

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/