On Fri, Aug 04, 2017 at 03:41:05PM +0200, Damien Pollet wrote:
> Stream >> newLineForWindows "convenience for the most common platforms
> Stream >> newLineForUnix
> Stream >> newLineForHistoricReasons
Practically speaking this looks insanely wordy. In 102% (est.) you want to use the same consistent newline and not thinking about for which platform you are writing every time you want to write a new line.
I think that most WriteStream miss what MultiByteFileStream has -- lineEndConvention.
fileStream lineEndConvention: #lf.
fileStream cr. "<- this will be autoconverted to #lf"
Also I would like to see a situation where you actually _want_ to use different line endings at the same time, so converting lf/cr to the global one shouldn't break things.
So maybe instead of stating what kind of line ending you want to write, you would specify them for the whole stream
> Stream >> newLineForWindows "convenience for the most common platforms
> Stream >> newLineForUnix
> Stream >> newLineForHistoricReasons
Stream>>beForCurrentPlatform (would be the default maybe?)
Stream>>beForWindows "crlf"
Stream>>beForUnix "lf"
Stream>>beAnnoyingOutsideOfPharo "cr"