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: Serge Hulne <serge hulne gmail com>
- To: Luca Bruno <lethalman88 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 18:08:25 +0200
I stand corrected !
Serge.
On Fri, Jul 8, 2011 at 5:55 PM, Luca Bruno <lethalman88 gmail com> wrote:
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]