Method Pike.yield()


Method yield

mixed yield(mixed val)

Description

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

Returns

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.

Note

Use of this function is only valid in generator functions.

See also

Generator functions