Re: [gtk-list] define-enum carries duplicate nice names
- From: Owen Taylor <owt1 cornell edu>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] define-enum carries duplicate nice names
- Date: 07 Dec 1997 10:09:42 -0500
Tim Janik <Tim.Janik@Hamburg.Netsurf.DE> writes:
> hi all,
>
> while implementing the new gluecode generator, i just came
> accross the following problem.
> on parsing enum definitions i encountered that quite a lot of
> the enum value "nice_name"s used for scheme code are duplicates e.g.:
>
> (define-enum GtkTroughType gtk
> (none GTK_TROUGH_NONE)
> (start GTK_TROUGH_START)
> (end GTK_TROUGH_END))
>
> (define-enum GtkPackType gtk
> (start GTK_PACK_START)
> (end GTK_PACK_END))
>
> here, `start' and `end' are identical. i know that for scheme code
> it is sufficient to have uniqueness of the enum value names only within
> specific types, but does this apply to all possible applications for
> enum value nice names?
I don't think we should try to force the last component to be
unique.
I think, if a language binding needs the names to be unique globally,
it should use the full name (GTK_PACK_START). If it needs unique
names within the "Gtk" module, it should use PACK_START, and if
it only needs things to be unique within an enumeration, then
it should use the last component. (START)
This probably does require changing gtk.defs to indicate a
"enumeration prefix.
(define-enum GtkPackType gtk pack
(start GTK_PACK_START)
(end GTK_PACK_END))
For cases like GdkEventType, whenre there is no enumeration prefix,
it could be specified as the empty string.
> also numeric characters in the first position of identifiers could
> cause problems with languages other than scheme, as in:
...
> (2button-press GDK_2BUTTON_PRESS)
> (3button-press GDK_3BUTTON_PRESS)
...
This might be a problem ... (is it actually a problem for any
languages? It is for CORBA IDL, but I've given up on that.)
Perhaps this should be changed to two-button-press, three-button-press.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]