Re: [Vala] Iterator for GLib.List?



JM wrote:
Hello

GLib.List<T> can be used with foreach(T t in list) in vala. This is
possible even without having an Iterator iterator(). So it looks like
this is not coming from methods with syntax support as mentioned in the
tutorial.
Is there some special code for GLib.List in vala

Yes, it's special code in the Vala compiler.

and if so, is there a
possibility to use it for custom code (like for a node like object that
has children chained to each other like in a double-linked list)? 

I guess the goal is not to add more special cases to Vala, that's why
"methods with syntax support" exist. Is there any reason not to use
them in your custom code for these node-like objects?


Best regards,

Frederik



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