Why does readln include the line terminator?

Georg Wrede georg.wrede at iki.fi
Tue Apr 14 08:48:45 PDT 2009


Manfred Nowak wrote:
> Georg Wrede wrote:
> 
>> because to do anything useful with a string, you have to strip the
>> terminator
> 
> This is false in case of simple copying. And I doubt, that for more 
> complex operations splitting `readln' into `readlnBody' and 
> `readlnEOL' and calling them intermittent would be of any benefit.

For copying there is the operating system command, copy.

Additionally, simple copy is hardly the most used thing when readln is 
invoked.

So, either, there should be two functions, one of which preserves the 
terminator, or (like in Tango) there should be a parameter to turn them on.




More information about the Digitalmars-d mailing list