Issue #8377 has been updated by henry.maddocks (Henry Maddocks).


rubiii (Daniel Harrington) wrote:
> I'm also very much in favour of this change for simplicity.
> 
> When I learned about Nokogiri, I had no idea how this was supposed to work: Nokogiri::XML('<xml/>')
> Simply changing the code to use a '.' instead of '::' makes it clear, that we're sending the '.XML' message.
> So why not encourage people to write code that is easier to read?!

But '.' and '::' mean different things. 
 '::' means you are calling the method that is defined inside the Nokogiri module/namespace. Changing it to use a dot means that you are sending a message to the object Nokogiri.

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

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/