Re: [Vala] [Bindings] Few quick questions about glib

----- Original Message ----
From: Yu Feng <rainwoodman gmail com>
To: Mihail Naydenov <mlists ymail com>
Cc: vala <vala-list gnome org>
Sent: Sunday, September 7, 2008 12:58:28 AM
Subject: Re: [Vala] [Bindings] Few quick questions about glib


> 2
> Why are all major string functions in glib (g_str*), member functions
> in a string class? Shouldn't  they be static in the class or even just
> functions in string namespace? In the end they all return a new string
> and do not use any class data.
Vala handles the difference within the compiler too. I believe there is
a special vala attribute in glib-2.0.vapi to let the compiler know that
'this' has changed after the function is called.

I was really asking from usability perspective, because after few unsuccessful attempts to use g_strdup_printf equivalent in vala, I had to google only to find out:

"%s: %d".printf ("Hello", 5)
is some weird, weird stuff !

I really thing most if not all g_str* functions should, if not moved, than at least copied in a separate String namspace, much like Rand and Random


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