pauses the enclosing incremental function that yields e.


IncrementalYield
pauses the enclosing incremental function that yields e.
Details

- IncrementalYield can only be used in Function expressions marked with IncrementalFunction.
- Functions in which IncrementalYield appears have to be processed by compiler functions such as FunctionCompile.
- After executing IncrementalYield, the incremental function will save its local variables and return the value to the caller.
- An incremental function that executes IncrementalYield can be woken up with a call to "Next".
Examples
Basic Examples (2)
An incremental function that has one yield:
A CompiledCodeFunction that returns an "IncrementalFunction" data structure:
Create an instance of the incremental function:
Run the incremental function to the IncrementalYield and return the partial result:
The incremental function has finished, so calling the "Next" operation results in a failure:
An incremental function that returns a sequence of multiples of its argument:
An instance of the incremental function that returns multiples of 7:
The first result from the incremental function:
A different instance of the incremental function that returns multiples of 17:
The first 100 multiples of 17:
The function that is returning multiples of 7 is still waiting to be woken up and return results:
See Also
IncrementalFunction Function Typed FunctionCompile FunctionDeclaration IncrementalReceive
Compiled Types: IncrementalFunction
Tech Notes
Related Guides
History
Text
Wolfram Research (2025), IncrementalYield, Wolfram Language function, https://reference.wolfram.com/language/ref/IncrementalYield.html.
CMS
Wolfram Language. 2025. "IncrementalYield." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IncrementalYield.html.
APA
Wolfram Language. (2025). IncrementalYield. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IncrementalYield.html
BibTeX
@misc{reference.wolfram_2025_incrementalyield, author="Wolfram Research", title="{IncrementalYield}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/IncrementalYield.html}", note=[Accessed: 04-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_incrementalyield, organization={Wolfram Research}, title={IncrementalYield}, year={2025}, url={https://reference.wolfram.com/language/ref/IncrementalYield.html}, note=[Accessed: 04-August-2025]}