Top "Yield-keyword" questions

yield is (1) a keyword that facilitates creation of generator functions, (2) a Ruby statement to transfer control from one coroutine to another, (3) a Java statement used to yield a value from a switch expression.

What does yield mean in PHP?

I've recently stumbled over this code: function xrange($min, $max) { for ($i = $min; $i <= $max; $i++) { yield $i; } } I've …

php generator php-5.5 yield-keyword
What are the main uses of yield(), and how does it differ from join() and interrupt()?

I am a little bit confused about the use of yield() method in Java, specifically in the example code below. …

java multithreading concurrent-programming yield-keyword
What does the "yield" keyword do in Ruby?

I encountered the following Ruby code: class MyClass attr_accessor :items ... def each @items.each{|item| yield item} end ... end …

ruby yield-keyword
"yield" keyword for C++, How to Return an Iterator from my Function?

Consider the following code. std::vector<result_data> do_processing() { pqxx::result input_data = get_data_from_database(); …

c++ iterator generator coroutine yield-keyword
Javascript check yield support

I read about the yield keyword in JavaScript and I need to use it in my project. I read that …

javascript keyword yield yield-keyword
Is it possible to use 'yield' to generate 'Iterator' instead of a list in Scala?

Is it possible to use yield as an iterator without evaluation of every value? It is a common task when …

scala yield continue yield-return yield-keyword