Re: namespaces



"muppet" <scott asofyet org> writes:

- it has been pointed out that G is not a neighbor-friendly namespace.  i
don't think that it stomps on anything, but it's only one letter.  then again,
i don't like GObject as a namespace because this module wraps GLib's main loop
and all other sorts of stuff.  GLib is a suggestion that sounded reasonable,
but i like G for aesthetic reasons, and the fact that it makes the names map
very very cleanly from C.  who wants to convince me to change it?  who wants
to argue to keep it?  (good arguments with examples, please)

for safety, I also think using a one-char only package name is
not advised.. why not "Glib"? that's what they use in gtkmm2.
(notice small 'l').

but then Glib2 would make more sense if Gtk2 is used, maybe?

- when creating a GtkListStore in C, you supply a list of GTypes specifying
the types of the columns.  i have changed this to a list of package names in
perl.  this means i have the G module automatically registering types to
packages such as G::String, G::Uint, G::Boolean, etc.  anybody have any better
ideas?  how about simpler names like 'string', 'uint', 'boolean' for the
fundamental types, and a package name for anything classes?

that's the solution they seem to use in gtkmm2, but let's noticed
"string" "bool" etc are c++ types. the full name would be more
verbose but also more orthogonal, I'd personally prefer that, but
that may be only matter of taste.
 
- i mapped g_timeout_add to G::Timeout->add, g_idle_add to G::Idle->add,
g_io_add_watch to G::IO->add_watch, and g_source_remove to G::Source->remove. 
any better ideas?

that makes no big deal but in the pas "timeout_add" was used,
maybe keeping this would be easier for people? e.g.
Glib2->timeout_add or something of the like.

-- 
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/



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