From: "jballanc (Joshua Ballanco)" Date: 2013-05-12T00:12:06+09:00 Subject: [ruby-core:54913] [ruby-trunk - Feature #8377] Deprecate :: for method calls in 2.1 Issue #8377 has been updated by jballanc (Joshua Ballanco). =begin I'm not sure how I feel about this. I understand the potential for confusion, but at the same time there's a certain congruity of being able to inherit from classes or methods that create classes in the same way. For example: module Foo class Bar def say "Hello from Bar!" end end def self.Bar(greeting) klass = Class.new klass.class_eval <<-END def say "#{greeting} from parameterized Bar!" end END klass end end class Baz < Foo::Bar def shout say.upcase end end class Quux < Foo::Bar("Howdy") def shout say.upcase end end puts Baz.new.shout puts Quux.new.shout 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... =end ---------------------------------------- Feature #8377: Deprecate :: for method calls in 2.1 https://bugs.ruby-lang.org/issues/8377#change-39252 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/