yield {coro}R Documentation

Yield a value from a generator

Description

The yield() statement suspends generator() functions. It works like return() except that the function continues execution at the yielding point when it is called again.

yield() can be called within loops and if-else branches but for technical reasons it can't be used anywhere in R code:

Usage

yield(x)

Arguments

x

A value to yield.

See Also

generator() for examples.


[Package coro version 1.0.4 Index]