After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 617197 - Macro for defining object and class
Macro for defining object and class
Status: RESOLVED DUPLICATE of bug 389585
Product: glib
Classification: Platform
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-04-29 16:37 UTC by andrewrazit
Modified: 2014-12-22 18:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Macros for defining an object and a class (899 bytes, text/plain)
2010-04-29 16:37 UTC, andrewrazit
Details

Description andrewrazit 2010-04-29 16:37:50 UTC
Created attachment 159909 [details]
Macros for defining an object and a class

There should be a macro for defining an object and one for defining a class.

This would show best practices, hide how this is done and be shorter than what is currently done.
Comment 1 Christian Persch 2010-04-29 16:52:19 UTC
Related to bug 341378.
Comment 2 Tor Lillqvist 2010-04-30 06:09:14 UTC
I don't want to take any position yet whether this idea as such is useful or not, but I strongly object (pun intended) to the naming / terminology.

Surely you aren't "defining" an "object" here? You define an object *type*, yes. But "objects" are *instances* of a type.
Comment 3 Matthias Clasen 2010-05-02 22:21:45 UTC
I don't think this buys you much, really. First of all, it doesn't _show_ the best practice, but hides it behind a macro. And then, it doesn't actually get you out of having to type out most of the boilerplate, since you can't define macros in macros.
Comment 4 Emmanuele Bassi (:ebassi) 2014-12-22 18:05:09 UTC
bug 389585 has an initial implementation that solves the "cannot define macros in macros" issue.

*** This bug has been marked as a duplicate of bug 389585 ***