⚠️ Warning: This is a draft ⚠️
This means it might contain formatting issues, incorrect code, conceptual problems, or other severe issues.
If you want to help to improve and eventually enable this page, please fork RosettaGit's repository and open a merge request on GitHub.
A non-parametric generator is an executable entity, function or procedure that contains code that yields a single generation of values from a sequence. Each time a generator is invoked, the next value in the sequence is provided.
Generators are often used in situations where a sequence is potentially infinite, and where it is possible to construct the next value of the sequence with only minimal state.
Examples of generator applications include:
- Generation of mathematical sequences
- Generation of unique invoice or ticket numbers
- Random and pseudorandom number generators
Note that non-parametric generators do not require a parameter to return the next value in sequence. However, there may be a reset mechanism that causes the generator to start again from the beginning of the sequence when next invoked.
[[Category:Solutions by Programming Task]]