From: Magnus Holm Date: 2013-05-14T04:01:38+09:00 Subject: [ruby-core:54970] Re: [ruby-trunk - Feature #8377] Deprecate :: for method calls in 2.1 --001a11c3fd124b395504dc9e25d6 Content-Type: text/plain; charset=UTF-8 On Sat, May 11, 2013 at 7:11 PM, jeremyevans0 (Jeremy Evans) < merch-redmine@jeremyevans.net> wrote: > > 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. Can't you use use #[] for this? class Quuz < Foo::Bar["Howdy"] end class User < Sequel::Model[:User] end doc = Nokogiri::XML[data] --001a11c3fd124b395504dc9e25d6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sat, May 11, 2013 at 7:11 PM, jeremyevans0 (Jeremy Evan= s) <merch-redmine@jeremyevans.net> wrote:

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:
>
> =C2=A0 =C2=A0 class Baz < Foo::Bar
> =C2=A0 =C2=A0 ...
> =C2=A0 =C2=A0 class Quux < Foo.Bar("Howdy")
> =C2=A0 =C2=A0 ...
>
> 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 Nokog= iri::XML()). =C2=A0Having 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. =C2=A0I don't train new ruby p= rogrammers, though, so maybe I underestimate the confusion this causes.

Can't you use use #[] for this?

=C2=A0 class Quuz < Foo::Bar["Howdy"]<= /div>
=C2=A0 end

=C2=A0 clas= s User < Sequel::Model[:User]
=C2=A0 end

=C2=A0 doc =3D N= okogiri::XML[data]=C2=A0
--001a11c3fd124b395504dc9e25d6--