Re: ranges.chunks and map! does not work

2018-07-05 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 5 July 2018 at 12:00:03 UTC, vit wrote: On Thursday, 5 July 2018 at 09:47:32 UTC, Andre Pany wrote: [...] roundRobin doesn't return RandomAccessRange => chunks doesn't return range of RandomAccessRange => Error: no [] operator overload try this: string content = roundRobi

Re: ranges.chunks and map! does not work

2018-07-05 Thread vit via Digitalmars-d-learn
On Thursday, 5 July 2018 at 09:47:32 UTC, Andre Pany wrote: Hi, the purpose of this code is to generate CSV based on 3 double arrays. I wonder why map cannot directly use the result of the chunks function. import std.experimental.all; void main() { double[] timestamps = [1.1]; doubl

Re: ranges.chunks and map! does not work

2018-07-05 Thread Alex via Digitalmars-d-learn
On Thursday, 5 July 2018 at 09:47:32 UTC, Andre Pany wrote: Is it correct that I need to call ".map!(c => c.array)"? Kind regards André Well, no. It depends on how you define the formatting string. This would also work: ´´´ import std.experimental.all; void main() { double[] timestamps

Re: ranges.chunks and map! does not work

2018-07-05 Thread Timoses via Digitalmars-d-learn
On Thursday, 5 July 2018 at 09:47:32 UTC, Andre Pany wrote: Hi, the purpose of this code is to generate CSV based on 3 double arrays. I wonder why map cannot directly use the result of the chunks function. import std.experimental.all; void main() { double[] timestamps = [1.1]; doubl

ranges.chunks and map! does not work

2018-07-05 Thread Andre Pany via Digitalmars-d-learn
Hi, the purpose of this code is to generate CSV based on 3 double arrays. I wonder why map cannot directly use the result of the chunks function. import std.experimental.all; void main() { double[] timestamps = [1.1]; double[] temperatures = [2.2]; double[] pressures = [3.3];