Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?



Brilliant,

Thank you very much indeed, Luca !

Please note that my note was merely an acknowledgement that, as a Vala
newbie, I tried successively two naive implementations, knew enough to
suspect intuitively one could push it a step further, but lacked the
know-how required to succeed in implementing a satisfactory solution at this
early stage of my study of the Vala language.


Use your fantasy before going down to conclusions :)
I fully agree !

Anyway, Thanks again, I am sure that it will prove very useful.


Serge

On Sat, Jul 9, 2011 at 9:23 AM, Luca Bruno <lethalman88 gmail com> wrote:

On Sat, Jul 09, 2011 at 09:01:42AM +0200, Serge Hulne wrote:
In the meantime, tried the "scanner" example (my last entry in the Vala
maling list with an iterator.

Of course, since the vala iterator returns one item at a time it does the
trick.

I've just published a generators example exploiting coroutines:
http://valajournal.blogspot.com/2011/07/generators-in-vala.html

Use your fantasy before going down to conclusions :)

--
http://www.debian.org - The Universal Operating System



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