Re: [gobject-introspection] How should name collisions be resolved



On Thu, Feb 10, 2011 at 12:14 PM, Alan <alan mcgovern gmail com> wrote:
> In .NET it is invalid to generate a property or a method which is the
> same name as an event as it is ambiguous as to whether you're invoking
> the event or calling the method.

Yeah, this fits into a general class of corner case restrictions from
a language mapping.  Similar to adding methods to a GObject interface
is OK in C, but an API break in the obvious Java and .NET mapping.

I think it'd be reasonable to add warnings for this to the
introspection scanner, but that doesn't help all the existing code out
there like GTK3 that just got released.

Related to this is the issue of language keywords; for example you
could call a method gtk_widget_switch () or something fine in C, but
then you end up with mywidget.switch() which is a problem since it's a
keyword.

> What are peoples opinions on taking care of this in the gir format and
> using the "renameto" feature to avoid the collision in all languages?
> Is this feasible? Are there any better ways of handling this kind of
> case?

We can do this for GTK3; but I'm loathe to use Rename-to except as a
binding band aid on top of a library that's already shipped.  It has
the compound problem that all of a sudden the *old* name isn't
accessible, and there was a possibility something was using it.


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