Minor std.stdio.File.ByLine rant

Jakob Ovrum jakobovrum at gmail.com
Wed Feb 26 16:16:21 PST 2014


On Thursday, 27 February 2014 at 00:07:47 UTC, H. S. Teoh wrote:
> On Wed, Feb 26, 2014 at 11:59:07PM +0000, bearophile wrote:
>> H. S. Teoh:
>> 
>> >I'm writing a CLI program that uses File.ByLine to read input
>> >commands,
>> 
>> Isn't using readln() better for that? File.byLine is to read 
>> lines
>> of files on disk.
> [...]
>
> Perhaps, but readln() isn't a range. The whole point was to use 
> a
> range-based API for the interpreter so that there's no need to 
> write two
> separate interfaces for the interpreter, one for stdin, one for 
> a script
> file stored on disk.
>
>
> T

Just write a function that accepts a std.stdio.File parameter?


More information about the Digitalmars-d mailing list