[Vala] Suprising behavior for Lists



Hi there, new on the list and new to Vala.
currently I'm just playing around a bit with it. And while using lists
vala generates c-code which fails to compile.

I'm doing something like this.

using GLib;
public class test{
        private List<string> _list;
        public List<string> list{
                get{ return _list; }
                set { _list = value; }
        }

        public void run(){
                list.append("hello");
                list.append("world");
        }
}

the append calls results results in lines like this
test_get_list (self) = g_list_append (test_get_list (self), g_strdup ("hello"));

which obviously doesn't work, something like this would probably make
more sense to generate.
test_set_list(self, g_list_append (test_get_list (self), g_strdup ("hello")));



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