Generators in D

Paul Backus snarwin at
Tue Feb 19 18:56:01 UTC 2019

On Tuesday, 19 February 2019 at 18:37:22 UTC, Matthew_Blake wrote:
> Hi there,
> is the concept of generators (like in Python, using yield) 
> available in D? If so, where can I find information?
> Regards

Generally speaking, things that are generators in Python are 
implemented as ranges [1] in D. If ranges aren't a good fit for 
your problem, though, you can also use opApply [2] and 
std.concurrency.Generator [3].


More information about the Digitalmars-d-learn mailing list