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;
}

data and next are fields, not methods. Why do you think that they should
be weak references?

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.

The string methods in Vala also don't modify an existing string
instance, they return a new string, so this should work fine. Strings
are considered immutable in Vala, just like in C# and Java.

Jürg





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