Re: [RFC][PATCH] Small enhancement for Glib::Object::Subclass




Jan Hudec said:
If SET_<property-name>/GET_<property-name> method exists, it is called.
Otherwise, the property is set to/retrieved from the hash.

I would actualy like set_/get_ prefixes better (such methods are more
suited to be called directly), but the following patch uses SET_/GET_
because that is less likely to break existing stuff.

most objects already have accessor methods named get_$name(), which will
invariably have different call signatures and could possibly result in
infinite recursion.  so, aesthetics must take a back seat.  :-/

i could say <handwaving>magical names like that open up lots of opportunity
for name clashes in the future</handwaving> but i'm not really *that* opposed
to the idea.

on the other hand, armed with the knowledge that Subclass.pm's
GET|SET_PROPERTY cannot be used in a file that is 'require'd rather than
'use'd, thanks to the usage of CHECK blocks, is it still important?  (that is,
you'll have to provide an implementation of GET|SET_PROPERTY anyway.)


PS: Should I add the patch to the BTS on sourceforge too?

SourceForge's Tracker sucks.  don't bother.


-- 
muppet <scott at asofyet dot org>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]