[Kde-bindings] KDE/kdebindings/ruby/qtruby/src

Richard Dale richard.dale at telefonica.net
Sun Jul 25 20:48:02 UTC 2010


On Sunday, July 25, 2010 09:33:31 pm Richard Dale wrote:
> On Sunday, July 25, 2010 06:51:34 pm Arno Rehn wrote:
> > On Sunday 25 July 2010 17:49:17 Sylvain Sauvage wrote:
> > >   Using a block might be less error-prone:
> > > obj.constCalls do |cobj|
> > > 
> > >   cobj.doSomething
> > > 
> > > end
> > 
> > Ah, that looks nice. :)
> > 
> > >   (Although, I can’t see when const method calls could be really
> > > 
> > > useful.)
> > 
> > Some classes have method overloads that only differ by constness and
> > where both have a different behaviour. An example is QDBusArgument,
> > where the non- const versions of beginMap() and the like won't work on
> > reply (i.e. read-only) values.
> 
> My opinion is that overloading on const-ness is a really bad idea. If it is
> so greate why can't do it in any language other than C++? So I prefer just
> giving the methods different names. Resolving overloaded methods based on
> whether the ruby variable are frozen is certainly like the C++ api, but to
> me that stuff was broken in the first place.
Actually come to think of it, what I am objecting to in this change, is that 
you have removed the renamed methods - why can't we have overloading on 
frozen-ness as well as the existing methods with different names for the people 
who prefer to do it that way?

-- Richard



More information about the Kde-bindings mailing list