Re: file io

2018-09-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/6/18 2:30 PM, Steven Schveighoffer wrote: On 9/6/18 1:07 PM, rikki cattermole wrote: On 07/09/2018 4:17 AM, Arun Chandrasekaran wrote: On Thursday, 6 September 2018 at 16:13:42 UTC, hridyansh thakur wrote: how to read a file line by line in D std.stdio.File.byLine() Refer the doc here:

Re: file io

2018-09-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/6/18 1:07 PM, rikki cattermole wrote: On 07/09/2018 4:17 AM, Arun Chandrasekaran wrote: On Thursday, 6 September 2018 at 16:13:42 UTC, hridyansh thakur wrote: how to read a file line by line in D std.stdio.File.byLine() Refer the doc here: https://dlang.org/library/std/stdio/file.by_lin

Re: file io

2018-09-06 Thread rikki cattermole via Digitalmars-d-learn
On 07/09/2018 4:17 AM, Arun Chandrasekaran wrote: On Thursday, 6 September 2018 at 16:13:42 UTC, hridyansh thakur wrote: how to read a file line by line in D std.stdio.File.byLine() Refer the doc here: https://dlang.org/library/std/stdio/file.by_line.html An example from the doc: ``` import

Re: file io

2018-09-06 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Thursday, 6 September 2018 at 16:13:42 UTC, hridyansh thakur wrote: how to read a file line by line in D std.stdio.File.byLine() Refer the doc here: https://dlang.org/library/std/stdio/file.by_line.html An example from the doc: ``` import std.algorithm, std.stdio, std.string; // Count w

Re: File IO: C# streams VS iterators?

2013-11-07 Thread Jacob Carlborg
On 2013-11-08 01:57, DDD wrote: I was watching a dconf talk about porting C# code to D. One thing that came up was there isn't anything like C# streams for D. Walter said he thinks iterators (unless I remember wrong) is superior. The speaker agreed but said it isn't a drop in replacement so that

Re: File IO: C# streams VS iterators?

2013-11-07 Thread Jacob Carlborg
On 2013-11-08 04:22, Lionello Lunesu wrote: However, sometimes it's useful to have polymorphism for accessing streams, especially when porting C#/java code to D. In that case it would be pretty trivial to port the base classes to D and implement them using the D ranges. For that, there's Tango

Re: File IO: C# streams VS iterators?

2013-11-07 Thread Lionello Lunesu
On 11/8/13, 8:57, DDD wrote: I was watching a dconf talk about porting C# code to D. One thing that came up was there isn't anything like C# streams for D. Walter said he thinks iterators (unless I remember wrong) is superior. The speaker agreed but said it isn't a drop in replacement so that is