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

Richard Dale richard.dale at telefonica.net
Sun Jul 25 20:33:31 UTC 2010


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.

-- Richard



More information about the Kde-bindings mailing list