Recommendations on avoiding range pipeline type hell

Chris Piker chris at hoopjump.com
Sat May 15 14:14:50 UTC 2021


On Saturday, 15 May 2021 at 13:43:29 UTC, Mike Parker wrote:
> On Saturday, 15 May 2021 at 11:25:10 UTC, Chris Piker wrote:

> In addition to what Adam said, if you do need to store the 
> result for use in a friendlier form, just import `std.array` 
> and append `.array` to the end of the pipeline. This will 
> eagerly allocate space for and copy the range elements to an 
> array, i.e., convert the range to a container:

Thanks for the suggestion.  Unfortunately the range is going to 
be 40+ years of Voyager magnetometer data processed in a pipeline.

I am trying to do everything in functional form, but the deep 
type dependencies (and my lack of knowledge) are crushing my 
productivity.  I might have to stop trying to write idiomatic D 
and start writing Java-in-D just to move this project along. 
Fortunately, D supports that too.


More information about the Digitalmars-d-learn mailing list