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



On Sat, 2008-09-06 at 14:40 -0700, Mihail Naydenov wrote:
1
public class List<G>    {
...
public G data;           //is this correct? Is not weak missing? Every
other member function returning the data or a new list returns weak
ref
public List<G> next; //same here
public weak List<G> prev;
}

vala handles the strong reference within the compiler. GList in vala
holds a strong reference to the data objects by default, which explains
the absence of the first weak in the class definition. I don't
understand the second absence of weak. believe or not, the vala compiler
handles GList very well and there is no problem.


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.


Yu

10x
MihailNajdnov


_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list




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