Macros and side-effects

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

 



I just had this small anoyance: when writing bindings from Gtk
to another language (Haskell, but it's not Gtk2hs, it's just
a personal use binding), I assigned constants to the value of
many macros in GObject Type Information section. Those would be
G_TYPE_CHAR, G_TYPE_INT etc.

Those macros are actually constants, except for one: G_TYPE_GTYPE.
It calls a function, and since the assignment was done at compile
time, I didn't have g_type_init() called.

I don't know if this is important for other languages, as
side-effects need special care in Haskell. But is there some
general rule I could follow on that?

Thanks,
Maurício

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list


[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux