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) ?

On Sat, Jul 09, 2011 at 08:04:38AM +0800, Nor Jaidi Tuah wrote:

"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."

I use such feature before in Ruby and miss it in Vala.
So, I'm anxiously awaiting the answer to the following question
in the original post.

Vala has no generators and this behavior has nothing to do with coroutines.
So I guess it's useless to show a possible solution without syntax
support, you would say "it's not the same".

-- - The Universal Operating System

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