Re: Using chunks with Generator

2017-03-14 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Mar 14, 2017 at 12:30:13PM +, Era Scarecrow via Digitalmars-d-learn wrote: > On Tuesday, 14 March 2017 at 10:00:24 UTC, Tetiana wrote: > > Build fails with the following error: > > Just looking at the Documentation, Generator is an InputRange and > chunks requires a ForwardRange (able

Re: Using chunks with Generator

2017-03-14 Thread Era Scarecrow via Digitalmars-d-learn
On Tuesday, 14 March 2017 at 10:00:24 UTC, Tetiana wrote: Build fails with the following error: Just looking at the Documentation, Generator is an InputRange and chunks requires a ForwardRange (able to use save functionality). So the API doesn't match up more or less. https://dlang.org/p

Using chunks with Generator

2017-03-14 Thread Tetiana via Digitalmars-d-learn
I'd like to evaluate values lazily and then process them one by one, using e.g. `map`. One of the steps requires processing the values in chunks. I was thinking of using a Generator for lazy evaluation, but I can't seem to make it work with the `chunks`. How can I make `std.range.chunks` work