Why does readln include the line terminator?

Georg Wrede georg.wrede at iki.fi
Wed Apr 15 03:40:43 PDT 2009


Andrei Alexandrescu wrote:
> I plan to implement a little API around these considerations, but 
> haven't gotten around to it. Particularly the regex thing is rather 
> thorny because std.regex does not distinguish classic regular 
> expressions from those needing backtracking, and does not have an 
> implementation that works with limited-lookahead streams. I suspect that 
> that would be a major effort.
> 
> Right now readln preserves the separator. The newer File.byLine 
> eliminates it by default and offers to keep it by calling 

Excellent!!

> File.byLine(KeepTerminator.yes). The allowed terminators are one 
> character or a string. See
> 
> http://erdani.dreamhosters.com/d/web/phobos/std_stdio.html#byLine

> I consider such an API adequate but insufficient; we need to add to it.



More information about the Digitalmars-d mailing list