Method Pike.yield()

Method yield

mixed yield(mixed val)


Stop execution of the current generator function for now, and return the value val.


Evaluates to the first argument passed to the generator function on restart.

Calling this special form is similar to the statement:

continue return val;

This syntax is however an expression and can thus be used to pass a value back.


Use of this function is only valid in generator functions.

See also

Generator functions