From: Eric Mahurin Date: 2008-04-24T05:28:39+09:00 Subject: Re: [RCR] Drop :: as a . synonym ------=_Part_9236_23242444.1208982517934 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Apr 23, 2008 at 9:21 AM, David A. Black wrote: > Hi -- > > I'd like to request the deprecation/removal of :: as a synonym for the > method-calling dot. I think it's a good opportunity to take out > something that Ruby doesn't need. We've already got the dot, which > always means "send a message", and :: already means something else > (constant resolution). I'd actually prefer to go the other way and add more value to both "::" and ".". a::b - gives an object named b in the scope of a a.b - calls an object named b in the scope of a With this, you'd have these as equivalents: a::b <=> a.method(:b) a.b <=> a::b.call a.b(x, y) <=> a::b.call(x, y) currying could also naturally come out of this: a::b(x, y) <=> a.method(:b).curry(x, y) a::b(x, y)[z] <=> a.method(:b).curry(x, y)[z] <=> a.b You could think of "a" being an object or a class in the above. What's in the scope would just be different. just my 2 cents... Eric ------=_Part_9236_23242444.1208982517934 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Apr 23, 2008 at 9:21 AM, David A. Black <dblack@rubypal.com> wrote:
Hi --

I'd like to request the deprecation/removal of :: as a synonym for the
method-calling dot. I think it's a good opportunity to take out
something that Ruby doesn't need. We've already got the dot, which
always means "send a message", and :: already means something else
(constant resolution).

I'd actually prefer to go the other way and  add  more value to both "::" and ".".

a::b - gives an object named b in the scope of a
a.b - calls an object named b in the scope of a

With this, you'd have these as equivalents:

a::b <=> a.method(:b)
a.b <=> a::b.call
a.b(x, y) <=> a::b.call(x, y)

currying could also naturally come out of this:

a::b(x, y) <=> a.method(:b).curry(x, y)
a::b(x, y)[z] <=> a.method(:b).curry(x, y)[z] <=> a.b

You could think of "a" being an object or a class in the above.  What's in the scope would just be different.

just my 2 cents...

Eric

------=_Part_9236_23242444.1208982517934--