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) ?
- From: Luca Bruno <lethalman88 gmail com>
- To: Serge Hulne <serge hulne gmail com>
- Cc: vala-list <vala-list gnome org>
- Subject: 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) ?
- Date: Fri, 8 Jul 2011 17:55:12 +0200
On Fri, Jul 08, 2011 at 05:49:32PM +0200, Serge Hulne wrote:
It‘s a generator using a coroutine (at least using “yield“).
The yield keyword itself doesn't mean coroutine. It's just a generator not a
coroutine because you don't cooperate with any other routine.
"The yield statement is only used when defining a generator function, and is
only used in the body of the generator function. Using a yield statement in
a function definition is sufficient to cause that definition to create a
generator function instead of a normal function."
That is, not a coroutine.
--
http://www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]